fix(fe): subscribe to capture-session store in components (was reading the store object)
`session.state` is a Svelte store; `$: state = session.state` bound the store object (not its value), so state.capture was undefined and cap.k threw on mount. Bind a local const to the store and use the $ prefix ($stateStore), and use get() in App.onPhotosReady. Verified in Chromium: hero -> batch -> sample uploads show thumbs.
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
export let session: CaptureSession;
|
||||
const dispatch = createEventDispatcher<{ continue: void }>();
|
||||
|
||||
$: state = session.state;
|
||||
const stateStore = session.state;
|
||||
$: state = $stateStore;
|
||||
$: items = session.lineup();
|
||||
$: measure = state.capture.k === 'measure' ? state.capture : null;
|
||||
$: results = measure?.results ?? null;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
export let session: CaptureSession;
|
||||
const dispatch = createEventDispatcher<{ 'photos-ready': void }>();
|
||||
|
||||
$: state = session.state;
|
||||
const stateStore = session.state;
|
||||
$: state = $stateStore;
|
||||
$: cap = state.capture;
|
||||
$: kind = cap.k;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user