From 2b55dfb4ae0f6ec083e0823872ba01a9e16201b3 Mon Sep 17 00:00:00 2001 From: seven Date: Thu, 28 Mar 2024 15:09:57 +0800 Subject: [PATCH] feat: enable auto update Signed-off-by: seven --- package-lock.json | 4 ++-- package.json | 2 +- src/electron/main.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 259271e..7f3192f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "DocKit", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "DocKit", - "version": "0.2.2", + "version": "0.2.3", "license": "Apache-2.0", "dependencies": { "buffer": "^6.0.3", diff --git a/package.json b/package.json index ea29b8e..fb2e684 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "DocKit", "productName": "DocKit", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "A faster, better and more stable NoSQL desktop tools", "author": "geekfun ", "license": "Apache-2.0", diff --git a/src/electron/main.ts b/src/electron/main.ts index 47155d7..b68c466 100644 --- a/src/electron/main.ts +++ b/src/electron/main.ts @@ -1,4 +1,5 @@ -import { app, autoUpdater, BrowserWindow, ipcMain, shell } from 'electron'; +import { app, BrowserWindow, ipcMain, shell } from 'electron'; +import { updateElectronApp } from 'update-electron-app'; import path from 'path'; import { createMenu } from './menu'; import { debug } from '../common'; @@ -108,11 +109,10 @@ registerSourceFileApiListener(ipcMain); registerFetchApiListener(ipcMain); try { - autoUpdater.setFeedURL({ - url: `https://dockit-eta.vercel.app//update/${process.platform}/${app.getVersion()}`, - }); + updateElectronApp(); } catch (err) { /* empty */ + console.log('failed to update app', err); } // In this file you can include the rest of your app's specific main process