From 6dfb7ba5628a143d9a08e767fa27f42b943eb1d0 Mon Sep 17 00:00:00 2001 From: Pierre Kisters Date: Thu, 7 May 2026 13:47:55 +0200 Subject: [PATCH] fix: print label uses wrong tenant on mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LabelMaker built the label URL from useCollections().selectedId, which is only populated when Collection/Selector.vue mounts. On mobile the sidebar (and the Selector inside it) lives in a Sheet that is conditionally rendered, so until the user opens the hamburger menu, selectedId stays null and the ?tenant= query param is omitted from the label URL. The backend then falls back to the user's default group, returning the wrong tenant's item — and because the URL is byte-identical between visits, the browser serves a cached image without firing a request. Switch to useViewPreferences().value.collectionId, matching the same pattern that 24e79952 applied to base-api.ts for attachments. --- frontend/components/global/LabelMaker.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/components/global/LabelMaker.vue b/frontend/components/global/LabelMaker.vue index 9e4083bb6..4ec1222bc 100644 --- a/frontend/components/global/LabelMaker.vue +++ b/frontend/components/global/LabelMaker.vue @@ -78,11 +78,11 @@ } function getLabelUrl(print: boolean): string { - const { selectedId } = useCollections(); + const prefs = useViewPreferences(); const params: Record = { print }; - if (selectedId.value) { - params.tenant = selectedId.value; + if (prefs.value.collectionId) { + params.tenant = prefs.value.collectionId; } if (props.type === "item" || props.type === "entity") {