preview-demo: seed settings through the installed window's storage
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7a896c5f93
commit
4d09a33ec2
1 changed files with 4 additions and 4 deletions
|
|
@ -40,9 +40,9 @@ const showBanner = (text: string) => {
|
|||
};
|
||||
|
||||
// The pose portraits are a setting that defaults off; a first visit turns it on so the demo shows them.
|
||||
const seedSettings = () => {
|
||||
if (localStorage.getItem('settings') === null) {
|
||||
localStorage.setItem('settings', JSON.stringify({ poseBubbles: true }));
|
||||
const seedSettings = (storage: Storage) => {
|
||||
if (storage.getItem('settings') === null) {
|
||||
storage.setItem('settings', JSON.stringify({ poseBubbles: true }));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ export const installDemo = (win: Window & typeof globalThis = window) => {
|
|||
routeOf(String(url), origin) === 'own' ? realBeacon(url, data) : false;
|
||||
}
|
||||
|
||||
seedSettings();
|
||||
seedSettings(win.localStorage);
|
||||
const stored = win.localStorage.getItem('cinny_hs_base_url');
|
||||
showBanner(stored !== null && stored !== DEMO_ORIGIN ? FOREIGN_SESSION_TEXT : BANNER_TEXT);
|
||||
return server;
|
||||
|
|
|
|||
Loading…
Reference in a new issue