Shereen Lee commited on
Commit
f0f78e1
·
1 Parent(s): c17e007

fix(map): show developed photos for the sample album too

Browse files

The 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.

Files changed (1) hide show
  1. 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
- // Switch to live store data only when the user has uploaded at least one
6102
- // photo beyond the seeded demos (id prefix "u"). Fall back to the curated
6103
- // Ottawa moments so the scrapbook layout looks right out of the box.
6104
- const hasUserPhotos = storePhotos.some((p) => String(p.id).startsWith("u"));
 
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">