mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
wip(mobile): checkpoint experience round three in progress
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VVYRAqiQj9Y1V9ZfG1RcDH
This commit is contained in:
4 files changed
+54
-7
No files matched your search
+23
-1
@@ -85,6 +85,14 @@ export function normMoment(m) {
|
||||
media: c.media || c.kind || 'photo',
|
||||
live: c.live || c.kind === 'live',
|
||||
distanceM: c.distanceM ?? c.rangeM ?? Math.round(dist(c)),
|
||||
headingDeg: Number.isFinite(c.headingDeg)
|
||||
? c.headingDeg
|
||||
: (Math.atan2(
|
||||
(subject.lon - c.lon) * Math.cos((c.lat * Math.PI) / 180),
|
||||
subject.lat - c.lat,
|
||||
) *
|
||||
180) /
|
||||
Math.PI,
|
||||
})),
|
||||
chat: (m.chat || []).map((c) => ({ ...c, handle: at(c.handle) })),
|
||||
posts: (m.posts || []).map((p) => ({
|
||||
@@ -556,7 +564,21 @@ export function createMomentPlayer({
|
||||
if (!m) return;
|
||||
cancelAnimationFrame(raf);
|
||||
raf = 0;
|
||||
globe.exitMoment();
|
||||
// Stop the clock and let a frame render before the engine tears the
|
||||
// Moment's primitives down (exiting mid-frame can stop Cesium's render).
|
||||
globe.playback.stop();
|
||||
const leaving = m;
|
||||
requestAnimationFrame(() =>
|
||||
requestAnimationFrame(() => {
|
||||
if (m === null || m === leaving) globe.exitMoment();
|
||||
}),
|
||||
);
|
||||
try {
|
||||
ext?.destroy?.();
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
ext = null;
|
||||
offOwn?.();
|
||||
offOwn = null;
|
||||
const was = m;
|
||||
|
||||
Reference in new issue
Block a user