simplify code

This commit is contained in:
Martin Raifer
2024-07-12 18:02:14 +02:00
parent 1d0f9e6447
commit 7d65b19d6d

View File

@@ -71,9 +71,7 @@ export function uiPhotoviewer(context) {
function setPhotoFromViewerButton() {
services.mapillary.ensureViewerLoaded(context).then(() => {
if (!services.mapillary.isViewerOpen()) return;
if (services.mapillary.isViewerOpen()) {
if (context.mode().id !== 'select' || !(layerStatus('mapillary') && getServiceId() === 'mapillary')) {
buttonRemove();
} else {
@@ -103,7 +101,7 @@ export function uiPhotoviewer(context) {
const annotation = t('operations.change_tags.annotation');
context.perform(action, annotation);
}
});
}
function layerStatus(which) {
const layers = context.layers();