fix(share): a bare address starts with the default layers

Layer choices saved in local storage were restored whenever the address carried
no link, so clearing the address and loading the bare URL brought the last
session's layers back and there was no way to a reset view. Start-up no longer
reads them: a link restores what its hash carries, and a bare address starts
from the defaults.
This commit is contained in:
Sameh Khamis committed 2026-11-19 12:26:32 -08:00
1 parent bcc25be07a
commit db1736266b
2 files changed
+11 -8

No files matched your search

+4 -3
View File
@@ -417,9 +417,10 @@ export class ShareRestoration {
this._layerStateRestorePromise = this._layerStateCoordinator.start({
shareLayerState: this._initialShareState?.layerState || null,
shareCreatedAtMs: this._initialShareState?.sharedAtMs ?? null,
// Any valid camera/style share isolates recipient-local preferences,
// including legacy and malformed-v2 layer payloads.
allowLocalState: !this._initialShareState,
// A link restores what it carries; a bare address is a clean start
// with the default layers. Saved layer choices never come back on
// their own, so clearing the address always resets the view.
allowLocalState: false,
});
if (this._initialShareSelectionSuperseded) {
this._layerStateCoordinator.cancelPendingShareTracking(