Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

fix: use prefs instead of use collection for attachments

tonyaellie24e79952a29c
diff --git a/frontend/lib/api/base/base-api.ts b/frontend/lib/api/base/base-api.ts
index 38c03767..fb170390 100644
--- a/frontend/lib/api/base/base-api.ts
+++ b/frontend/lib/api/base/base-api.ts
@@ -77,13 +77,14 @@ export class BaseAPI {
// URL already has a query param, this will not work.
authURL(url: string): string {
if (this.attachmentToken) {
- const { selectedId } = useCollections();
- return route(
- url,
- selectedId.value
- ? { access_token: this.attachmentToken, tenant: selectedId.value }
- : { access_token: this.attachmentToken }
- );
+ const params: Record<string, string> = { access_token: this.attachmentToken };
+
+ const prefs = useViewPreferences();
+ if (prefs.value.collectionId) {
+ params.tenant = prefs.value.collectionId;
+ }
+
+ return route(url, params);
}
return url;
}