fix null state

This commit is contained in:
Vikeo
2024-05-27 10:58:42 +02:00
parent 2ec9998a2a
commit 63fbceafe2
2 changed files with 4 additions and 4 deletions

View File

@@ -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>
</>
)}

View File

@@ -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 (