Skip to content

Commit

Permalink
fix access control logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed May 30, 2024
1 parent c2876b8 commit af003ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/editor/components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
Expand Down Expand Up @@ -272,7 +272,7 @@ export default class Main extends Component {
<HelpButton />
</div>
)}
{isProUser && this.state.inspectorEnabled && (
{this.state.inspectorEnabled && (
<div id="geo">
<GeoPanel />
</div>
Expand Down
38 changes: 17 additions & 21 deletions src/editor/components/modals/GeoModal/GeoModal.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit af003ab

Please sign in to comment.