Last round of prettier: npx prettier --write src/
This commit is contained in:
@@ -24,7 +24,10 @@ import { browser } from '$app/environment';
|
||||
// `BeforeInstallPromptEvent` is non-standard and not included in TypeScript's default lib.
|
||||
interface BeforeInstallPromptEvent extends Event {
|
||||
prompt(): Promise<void>;
|
||||
userChoice: Promise<{ outcome: 'accepted' | 'dismissed'; platform: string }>;
|
||||
userChoice: Promise<{
|
||||
outcome: 'accepted' | 'dismissed';
|
||||
platform: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
const DISMISS_KEY = 'ae_pwa_install_dismissed';
|
||||
@@ -58,7 +61,8 @@ function _in_standalone(): boolean {
|
||||
return (
|
||||
window.matchMedia('(display-mode: standalone)').matches ||
|
||||
// iOS Safari sets navigator.standalone (non-standard)
|
||||
('standalone' in window.navigator && (window.navigator as any).standalone === true)
|
||||
('standalone' in window.navigator &&
|
||||
(window.navigator as any).standalone === true)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +91,9 @@ export const pwa_install = {
|
||||
* We cannot trigger a native prompt on iOS so we show manual instructions instead.
|
||||
*/
|
||||
get is_ios_nudge(): boolean {
|
||||
return _is_ios() && !_in_standalone() && !_is_dismissed && !_is_installed;
|
||||
return (
|
||||
_is_ios() && !_in_standalone() && !_is_dismissed && !_is_installed
|
||||
);
|
||||
},
|
||||
|
||||
/** True if the install UI should be rendered at all. */
|
||||
@@ -147,5 +153,5 @@ export const pwa_install = {
|
||||
dismiss(): void {
|
||||
_is_dismissed = true;
|
||||
if (browser) localStorage.setItem(DISMISS_KEY, Date.now().toString());
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user