From 7d65b19d6d2c8abfbff5f3130cb2f622a06bac45 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 12 Jul 2024 18:02:14 +0200 Subject: [PATCH] simplify code --- modules/ui/photoviewer.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/ui/photoviewer.js b/modules/ui/photoviewer.js index 99ebeca4d..70340d2af 100644 --- a/modules/ui/photoviewer.js +++ b/modules/ui/photoviewer.js @@ -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();