feat: add web update check and installation functionality
This commit is contained in:
@@ -9,6 +9,9 @@ export type UpdateInfo = {
|
||||
currentVersion: string;
|
||||
body?: string;
|
||||
date?: string;
|
||||
// Web-specific fields
|
||||
packageManager?: string;
|
||||
updateCommand?: string;
|
||||
};
|
||||
|
||||
export type UpdateProgress = {
|
||||
@@ -71,6 +74,12 @@ export const isVSCodeRuntime = (): boolean => {
|
||||
return apis?.runtime?.isVSCode === true;
|
||||
};
|
||||
|
||||
export const isWebRuntime = (): boolean => {
|
||||
if (typeof window === "undefined") return false;
|
||||
// Web runtime: not desktop, not VSCode
|
||||
return !isDesktopRuntime() && !isVSCodeRuntime();
|
||||
};
|
||||
|
||||
export const getDesktopApi = (): DesktopApi | null => {
|
||||
if (!isDesktopRuntime()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user