Spaces:
Paused
Paused
Shereen Lee commited on
Commit ·
f0f78e1
1
Parent(s): c17e007
fix(map): show developed photos for the sample album too
Browse filesThe scrapbook only treated the store as 'live' when it held an upload (id prefix
'u'), so the 'Try a sample album' photos (ids 'p1'..'p4') were ignored and the
map fell back to the hardcoded demo moments — i.e. the originals, even after the
watercolour develop wrote back. Since the store now starts empty, any photo in
it is user-loaded, so switch the gate to 'store has any photo' and only fall
back to the demo when it's genuinely empty.
- index.html +5 -4
index.html
CHANGED
|
@@ -6098,10 +6098,11 @@
|
|
| 6098 |
const setSelectedId = (v) => { setSelectedIdRaw(v); Collab.send("selection", { value: v }); };
|
| 6099 |
const current = MAP_VARIANTS.find((v) => v.id === variant) || MAP_VARIANTS[0];
|
| 6100 |
const storePhotos = usePhotos();
|
| 6101 |
-
//
|
| 6102 |
-
//
|
| 6103 |
-
//
|
| 6104 |
-
|
|
|
|
| 6105 |
const liveMoments = hasUserPhotos ? storePhotos.map(storeToMoment) : moments;
|
| 6106 |
return (
|
| 6107 |
<section className="flex w-full max-w-7xl flex-col overflow-hidden rounded-xl border-2 border-primary bg-card shadow-lg sm:flex-row">
|
|
|
|
| 6098 |
const setSelectedId = (v) => { setSelectedIdRaw(v); Collab.send("selection", { value: v }); };
|
| 6099 |
const current = MAP_VARIANTS.find((v) => v.id === variant) || MAP_VARIANTS[0];
|
| 6100 |
const storePhotos = usePhotos();
|
| 6101 |
+
// The store starts EMPTY, so any photo in it was loaded by the user -
|
| 6102 |
+
// whether uploaded ("u" ids) or from the sample album ("p" ids). Only fall
|
| 6103 |
+
// back to the curated demo moments when the store is genuinely empty, so
|
| 6104 |
+
// developed watercolours always carry through to the map.
|
| 6105 |
+
const hasUserPhotos = storePhotos.some((p) => p && p.src);
|
| 6106 |
const liveMoments = hasUserPhotos ? storePhotos.map(storeToMoment) : moments;
|
| 6107 |
return (
|
| 6108 |
<section className="flex w-full max-w-7xl flex-col overflow-hidden rounded-xl border-2 border-primary bg-card shadow-lg sm:flex-row">
|