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