Fix Load Albums button in the photos widget dialog
Build and push server image / test (push) Successful in 21s
Build and push server image / build-and-push (push) Successful in 2m4s
Build and push server image / deploy (push) Successful in 56s

The dialog calls /albums via window.FRAME_API, but that's repointed to
this widget's own API base while a dialog is open (see frame_layout.js)
-- /albums is frame-level (lists the owner's whole Immich library, not
scoped to one photo widget), so it needs window.FRAME_BASE_API instead.
The button silently 404'd since the resulting URL never existed.
This commit is contained in:
2026-07-24 14:39:01 -04:00
parent a33a3a71e4
commit cb11ffdd2d
+6 -1
View File
@@ -73,7 +73,12 @@ async function savePhotoSettings() {
function initPhotosDialog() {
document.getElementById('load-albums').addEventListener('click', async () => {
try {
const resp = await fetch(`${window.FRAME_API}/albums`);
// /albums is frame-level (routers/api_frames.py) -- it lists the
// frame owner's whole Immich library, not something scoped to
// this one photo widget -- so it uses window.FRAME_BASE_API (the
// stable frame-level base), not window.FRAME_API (repointed to
// this widget's own API base while the dialog is open).
const resp = await fetch(`${window.FRAME_BASE_API}/albums`);
if (!resp.ok) {
throw new Error(await apiError(resp));
}