Update DesktopEventHandler.tsx (#6376)

This commit is contained in:
Tom Moor
2024-01-12 06:18:12 -08:00
committed by GitHub
parent 2505fea103
commit 8360c2dec9

View File

@@ -12,6 +12,7 @@ export default function DesktopEventHandler() {
const { t } = useTranslation();
const history = useHistory();
const { dialogs } = useStores();
const hasDisabledUpdateMessage = React.useRef(false);
React.useEffect(() => {
Desktop.bridge?.redirect((path: string, replace = false) => {
@@ -23,6 +24,11 @@ export default function DesktopEventHandler() {
});
Desktop.bridge?.updateDownloaded(() => {
if (hasDisabledUpdateMessage.current) {
return;
}
hasDisabledUpdateMessage.current = true;
toast.message("An update is ready to install.", {
duration: Infinity,
dismissible: true,