Skip to content

Commit f8c37e6

Browse files
Copilottacruc
andcommitted
Complete fix for photo viewer in public shared Maps
Co-authored-by: tacruc <402891+tacruc@users.noreply.github.com>
1 parent f6f775c commit f8c37e6

File tree

21 files changed

+1412
-1402
lines changed

21 files changed

+1412
-1402
lines changed

src/components/Map.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ import { getCurrentUser } from '@nextcloud/auth'
170170
import axios from '@nextcloud/axios'
171171
import { showError, showSuccess } from '@nextcloud/dialogs'
172172
173-
import { LocateControl } from "leaflet.locatecontrol"
173+
import { LocateControl } from 'leaflet.locatecontrol'
174174
import 'leaflet.locatecontrol/dist/L.Control.Locate.min.css'
175175
import L from 'leaflet'
176176
import 'mapbox-gl/dist/mapbox-gl'
@@ -210,22 +210,22 @@ import PhotoSuggestionsLayer from './map/PhotoSuggestionsLayer.vue'
210210
211211
// exclude dynamic imports from webpack-processing
212212
L.Control.Elevation.include({
213-
import: function(src, condition) {
213+
import(src, condition) {
214214
if (Array.isArray(src)) {
215-
return Promise.all(src.map(m => this.import(m)));
215+
return Promise.all(src.map(m => this.import(m)))
216216
}
217-
switch(src) {
218-
case this.__D3: condition = typeof d3 !== 'object'; break;
219-
case this.__TOGEOJSON: condition = typeof toGeoJSON !== 'object'; break;
220-
case this.__LGEOMUTIL: condition = typeof L.GeometryUtil !== 'object'; break;
221-
case this.__LALMOSTOVER: condition = typeof L.Handler.AlmostOver !== 'function'; break;
222-
case this.__LDISTANCEM: condition = typeof L.DistanceMarkers !== 'function'; break;
223-
case this.__LEDGESCALE: condition = typeof L.Control.EdgeScale !== 'function'; break;
224-
case this.__LHOTLINE: condition = typeof L.Hotline !== 'function'; break;
217+
switch (src) {
218+
case this.__D3: condition = typeof d3 !== 'object'; break
219+
case this.__TOGEOJSON: condition = typeof toGeoJSON !== 'object'; break
220+
case this.__LGEOMUTIL: condition = typeof L.GeometryUtil !== 'object'; break
221+
case this.__LALMOSTOVER: condition = typeof L.Handler.AlmostOver !== 'function'; break
222+
case this.__LDISTANCEM: condition = typeof L.DistanceMarkers !== 'function'; break
223+
case this.__LEDGESCALE: condition = typeof L.Control.EdgeScale !== 'function'; break
224+
case this.__LHOTLINE: condition = typeof L.Hotline !== 'function'; break
225225
}
226-
let url = (new URL(src, (src.startsWith('../') || src.startsWith('./')) ? this.options.srcFolder : undefined)).toString();
227-
return condition !== false ? import(/* webpackIgnore: true */ url) : Promise.resolve();
228-
}
226+
const url = (new URL(src, (src.startsWith('../') || src.startsWith('./')) ? this.options.srcFolder : undefined)).toString()
227+
return condition !== false ? import(/* webpackIgnore: true */ url) : Promise.resolve()
228+
},
229229
})
230230
231231
export default {

src/components/Sidebar/PhotoSuggestionsSidebarTab.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ export default {
297297
const token = getToken()
298298
if (token) {
299299
// For public shares, pass the share token to the Viewer
300-
OCA.Viewer.open({
301-
path: photo.path,
300+
OCA.Viewer.open({
301+
path: photo.path,
302302
list: this.photoSuggestionsSelected,
303-
shareToken: token
303+
shareToken: token,
304304
})
305305
} else {
306306
// For logged-in users, use the standard approach

0 commit comments

Comments
 (0)