Skip to content

Commit 764e438

Browse files
committed
Fix auto-update logic
1 parent 91efef6 commit 764e438

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
desktop: patch
3+
---
4+
5+
Fix auto-update not working correctly

apps/desktop/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config: Configuration = {
1111
'**/node_modules/@the-dev-tools/cli/dist/cli*',
1212
],
1313
extraMetadata: {
14-
name: 'DevTools Studio',
14+
name: 'DevTools-Studio',
1515
},
1616
files: ['!src/*', '!*.{js,ts}', '!{tsconfig.json,tsconfig.*.json}'],
1717
linux: {

apps/desktop/src/main/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ const onReady = Effect.gen(function* () {
193193
return methodFunction(...options);
194194
});
195195

196-
ipcMain.handle('update:check', () => autoUpdater.checkForUpdates().then((_) => _?.updateInfo.version));
196+
ipcMain.handle('update:check', () =>
197+
autoUpdater.checkForUpdates().then((_) => (_?.isUpdateAvailable ? _.updateInfo.version : null)),
198+
);
197199
ipcMain.on('update:start', () => void autoUpdater.downloadUpdate());
198200
autoUpdater.on('download-progress', (_) => void mainWindow.webContents.send('update:progress', _));
199201
autoUpdater.on('update-downloaded', () => void autoUpdater.quitAndInstall());

0 commit comments

Comments
 (0)