From af003aba04859a508c2f5c9c058ad270345d5515 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 30 May 2024 16:26:11 -0700 Subject: [PATCH] fix access control logic --- src/editor/components/Main.js | 4 +- .../modals/GeoModal/GeoModal.component.jsx | 38 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/editor/components/Main.js b/src/editor/components/Main.js index 83760b547..06a541a2d 100644 --- a/src/editor/components/Main.js +++ b/src/editor/components/Main.js @@ -210,7 +210,7 @@ export default class Main extends Component { const scene = this.state.sceneEl; const isEditor = !!this.state.inspectorEnabled; const sceneData = AFRAME.scenes[0].getAttribute('metadata', 'sceneTitle'); - const isProUser = currentUser && currentUser.isBeta; + const isProUser = currentUser && currentUser.isPro; return (
@@ -272,7 +272,7 @@ export default class Main extends Component {
)} - {isProUser && this.state.inspectorEnabled && ( + {this.state.inspectorEnabled && (
diff --git a/src/editor/components/modals/GeoModal/GeoModal.component.jsx b/src/editor/components/modals/GeoModal/GeoModal.component.jsx index 372c4eeca..4dad06c7f 100644 --- a/src/editor/components/modals/GeoModal/GeoModal.component.jsx +++ b/src/editor/components/modals/GeoModal/GeoModal.component.jsx @@ -12,7 +12,7 @@ import GeoImg from '../../../../../ui_assets/geo.png'; const GeoModal = ({ isOpen, onClose }) => { const { currentUser } = useAuthContext(); - const isProUser = currentUser && currentUser.isBeta; + const isProUser = currentUser && currentUser.isPro; const [markerPosition, setMarkerPosition] = useState({ lat: 0, lng: 0, @@ -50,27 +50,23 @@ const GeoModal = ({ isOpen, onClose }) => { }); const onSaveHandler = () => { - if (!isProUser) { - onClose(); - } else { - const latitude = markerPosition.lat; - const longitude = markerPosition.lng; - const elevation = markerPosition.elevation; - AFRAME.scenes[0].setAttribute('metadata', 'coord', { - latitude: latitude, - longitude: longitude, - elevation: elevation - }); - const geoLayer = document.getElementById('reference-layers'); - geoLayer.setAttribute( - 'street-geo', - `latitude: ${latitude}; longitude: ${longitude}; elevation: ${elevation}` - ); - // this line needs to update 3D tiles from the Editor. Need to delete after updating aframe-loaders-3dtiles-component - geoLayer.play(); + const latitude = markerPosition.lat; + const longitude = markerPosition.lng; + const elevation = markerPosition.elevation; + AFRAME.scenes[0].setAttribute('metadata', 'coord', { + latitude: latitude, + longitude: longitude, + elevation: elevation + }); + const geoLayer = document.getElementById('reference-layers'); + geoLayer.setAttribute( + 'street-geo', + `latitude: ${latitude}; longitude: ${longitude}; elevation: ${elevation}` + ); + // this line needs to update 3D tiles from the Editor. Need to delete after updating aframe-loaders-3dtiles-component + geoLayer.play(); - onClose(); - } + onClose(); }; return (