fix(mac): updater progress UI and skip redundant download
Show update stage in the modal, forward electron-updater progress over IPC, and install immediately when the build is already cached. Rename window titles to TTRPG - *. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,7 @@ export const ipcChannels = {
|
||||
updater: {
|
||||
check: 'updater.check',
|
||||
downloadAndRestart: 'updater.downloadAndRestart',
|
||||
progress: 'updater.progress',
|
||||
},
|
||||
project: {
|
||||
list: 'project.list',
|
||||
@@ -97,6 +98,22 @@ export type UpdaterCheckResponse =
|
||||
|
||||
export type UpdaterDownloadResponse = { ok: true } | { ok: false; message: string };
|
||||
|
||||
export type UpdaterProgressPhase =
|
||||
| 'checking'
|
||||
| 'available'
|
||||
| 'not-available'
|
||||
| 'downloading'
|
||||
| 'installing'
|
||||
| 'error';
|
||||
|
||||
export type UpdaterProgressEvent = {
|
||||
phase: UpdaterProgressPhase;
|
||||
/** 0..100 при phase=downloading */
|
||||
percent?: number;
|
||||
version?: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export type IpcEventMap = {
|
||||
[ipcChannels.session.stateChanged]: { state: SessionState };
|
||||
[ipcChannels.effects.stateChanged]: { state: EffectsState };
|
||||
@@ -105,6 +122,7 @@ export type IpcEventMap = {
|
||||
[ipcChannels.windows.multiWindowStateChanged]: { open: boolean };
|
||||
[ipcChannels.project.importZipProgress]: ZipProgressEvent;
|
||||
[ipcChannels.project.exportZipProgress]: ZipProgressEvent;
|
||||
[ipcChannels.updater.progress]: UpdaterProgressEvent;
|
||||
};
|
||||
|
||||
export type IpcInvokeMap = {
|
||||
@@ -121,7 +139,7 @@ export type IpcInvokeMap = {
|
||||
res: UpdaterCheckResponse;
|
||||
};
|
||||
[ipcChannels.updater.downloadAndRestart]: {
|
||||
req: Record<string, never>;
|
||||
req: { version: string };
|
||||
res: UpdaterDownloadResponse;
|
||||
};
|
||||
[ipcChannels.project.list]: {
|
||||
|
||||
Reference in New Issue
Block a user