fix(library): put a cloud frame back before opening the studio
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
onThumbWritten,
|
||||
pickFolder,
|
||||
putFolder,
|
||||
putPhotosFast,
|
||||
readPhotoFile,
|
||||
readPhotos,
|
||||
reconnectPhotosForFolders,
|
||||
@@ -1444,8 +1445,12 @@ function Catalogue({ admin, user }: { admin: boolean; user: User | null }) {
|
||||
// is running the address bar is the one thing that changes — `go` keeps the
|
||||
// reading where it is instead of reloading the page out from under it.
|
||||
const open = useCallback(async (photo: LibraryPhoto) => {
|
||||
const row = await getPhoto(photo.id);
|
||||
// A cloud frame is read from its own server by the studio, so a row this
|
||||
// store no longer holds is put back instead of dropping the click — the
|
||||
// catalogue already has the frame, and the server has its bytes.
|
||||
const row = (await getPhoto(photo.id)) ?? (photo.remoteId ? photo : null);
|
||||
if (!row) return;
|
||||
if (row === photo) await putPhotosFast([photo]);
|
||||
// Read once here so a moved or deleted file answers with a note instead of
|
||||
// a studio that opens on nothing.
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user