mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-11 21:56:25 +00:00
fix null state
This commit is contained in:
@@ -2,7 +2,7 @@ import { twc } from 'react-twc';
|
|||||||
import { useAnalytics } from '../../Hooks/useAnalytics';
|
import { useAnalytics } from '../../Hooks/useAnalytics';
|
||||||
import { useGlobalSettings } from '../../Hooks/useGlobalSettings';
|
import { useGlobalSettings } from '../../Hooks/useGlobalSettings';
|
||||||
import { PreStartMode } from '../../Types/Settings';
|
import { PreStartMode } from '../../Types/Settings';
|
||||||
import { InstallPWA } from '../Misc/InstallPWAButton';
|
import { InstallPWAButton } from '../Misc/InstallPWAButton';
|
||||||
import { Separator } from '../Misc/Separator';
|
import { Separator } from '../Misc/Separator';
|
||||||
import { Paragraph } from '../Misc/TextComponents';
|
import { Paragraph } from '../Misc/TextComponents';
|
||||||
import { ToggleButton } from '../Misc/ToggleButton';
|
import { ToggleButton } from '../Misc/ToggleButton';
|
||||||
@@ -291,7 +291,7 @@ export const SettingsDialog = ({
|
|||||||
</Description>
|
</Description>
|
||||||
</SettingContainer>
|
</SettingContainer>
|
||||||
<div className="flex w-full justify-center">
|
<div className="flex w-full justify-center">
|
||||||
<InstallPWA />
|
<InstallPWAButton />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react';
|
|||||||
import { BeforeInstallPromptEvent } from '../../global';
|
import { BeforeInstallPromptEvent } from '../../global';
|
||||||
import { useAnalytics } from '../../Hooks/useAnalytics';
|
import { useAnalytics } from '../../Hooks/useAnalytics';
|
||||||
|
|
||||||
export const InstallPWA = () => {
|
export const InstallPWAButton = () => {
|
||||||
const supportsPWARef = useRef<boolean>(false);
|
const supportsPWARef = useRef<boolean>(false);
|
||||||
const [promptInstall, setPromptInstall] =
|
const [promptInstall, setPromptInstall] =
|
||||||
useState<BeforeInstallPromptEvent | null>(null);
|
useState<BeforeInstallPromptEvent | null>(null);
|
||||||
@@ -22,7 +22,7 @@ export const InstallPWA = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!supportsPWARef.current) {
|
if (!supportsPWARef.current) {
|
||||||
return 'lull';
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user