fix: portable flag

This commit is contained in:
MystiPanda
2023-12-15 21:39:34 +08:00
parent fa89fe3e87
commit 981f9d0b01
10 changed files with 47 additions and 18 deletions

View File

@@ -22,6 +22,9 @@ import { useCustomTheme } from "@/components/layout/use-custom-theme";
import getSystem from "@/utils/get-system";
import "dayjs/locale/ru";
import "dayjs/locale/zh-cn";
import { getPortableFlag } from "@/services/cmds";
export let portableFlag = false;
dayjs.extend(relativeTime);
@@ -71,10 +74,12 @@ const Layout = () => {
break;
}
});
setTimeout(() => {
void appWindow.unminimize();
void appWindow.show();
void appWindow.setFocus();
setTimeout(async () => {
portableFlag = await getPortableFlag();
await appWindow.unminimize();
await appWindow.show();
await appWindow.setFocus();
}, 50);
}, []);
@@ -119,9 +124,7 @@ const Layout = () => {
<div className="the-logo" data-windrag>
<LogoSvg />
{!(OS === "windows" && WIN_PORTABLE) && (
<UpdateButton className="the-newbtn" />
)}
{!portableFlag && <UpdateButton className="the-newbtn" />}
</div>
<List className="the-menu">