diff --git a/type/web.ts b/type/web.ts index 86d3d37d..38b94b4b 100644 --- a/type/web.ts +++ b/type/web.ts @@ -13,19 +13,25 @@ import { export type BuiltinSettings = { indexPage: string; - customStyles?: string | string[]; - plugOverrides?: Record>; shortcuts?: Shortcut[]; - hideSyncButton?: boolean; - hideEditButton?: boolean; useSmartQuotes?: boolean; maximumAttachmentSize?: number; - defaultLinkStyle?: string; + // Open the last page that was open when the app was closed + pwaOpenLastPage?: boolean; + // UI visuals + hideEditButton?: boolean; + hideSyncButton?: boolean; actionButtons: ActionButton[]; pageDecorations?: PageDecoration[]; // Format: compatible with docker ignore spaceIgnore?: string; emoji?: EmojiConfig; + // DEPRECATED: Use space styles instead + customStyles?: string | string[]; + // DEPRECATED: Use shortcuts instead + plugOverrides?: Record>; + // NOTE: Bit niche, maybe delete at some point? + defaultLinkStyle?: string; }; export type PanelConfig = { diff --git a/web/client.ts b/web/client.ts index 2e7f3498..83a39de7 100644 --- a/web/client.ts +++ b/web/client.ts @@ -451,7 +451,7 @@ export class Client { ); }); - if (location.hash === "#boot") { + if (location.hash === "#boot" && this.settings.pwaOpenLastPage !== false) { (async () => { // Cold start PWA load const lastPage = await this.stateDataStore.get([ diff --git a/website/SETTINGS.md b/website/SETTINGS.md index 664ac49b..40c38f23 100644 --- a/website/SETTINGS.md +++ b/website/SETTINGS.md @@ -19,6 +19,9 @@ hideSyncButton: false # Hide the edit button (available on mobile only) hideEditButton: true # defaults to 'false' +# In PWA mode, SilverBullet automatically reopens the last opened page on boot, this can be disabled +pwaOpenLastPage: true + # Configure the shown action buttons (top right bar) actionButtons: - icon: home # Use any icon from https://feathericons.com