mirror of
https://github.com/bitinflow/rerun-encoder.git
synced 2026-03-13 13:46:00 +00:00
Improve auto-update
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import {app, BrowserWindow, ipcMain, shell} from 'electron'
|
||||
import {release} from 'node:os'
|
||||
import {join} from 'node:path'
|
||||
import {Settings} from "../../shared/schema";
|
||||
import {EncoderOptions, Settings} from "../../shared/schema";
|
||||
import {SettingsRepository} from "../rerun-manager/settings-repository";
|
||||
import {Encoder, EncoderOptions} from "../rerun-manager/encoder";
|
||||
import IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
||||
import {Encoder} from "../rerun-manager/encoder";
|
||||
import {InternalServer} from "../rerun-manager/internal-server";
|
||||
import {emit} from "./helpers";
|
||||
import {platform} from "node:process";
|
||||
import IpcMainInvokeEvent = Electron.IpcMainInvokeEvent;
|
||||
|
||||
// The built directory structure
|
||||
//
|
||||
@@ -41,7 +41,11 @@ if (require('electron-squirrel-startup')) {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
require('update-electron-app')()
|
||||
require('update-electron-app')({
|
||||
repo: 'bitinflow/rerun-encoder',
|
||||
updateInterval: '1 hour',
|
||||
logger: require('electron-log')
|
||||
})
|
||||
|
||||
// Remove electron security warnings
|
||||
// This warning only shows in development mode
|
||||
@@ -150,7 +154,7 @@ ipcMain.handle('open-win', (_, arg) => {
|
||||
|
||||
ipcMain.handle('version', async () => app.getVersion())
|
||||
ipcMain.handle('settings', async () => settingsRepository.getSettings())
|
||||
ipcMain.handle('logout', async () => settingsRepository.logout())
|
||||
ipcMain.handle('logout', async () => await settingsRepository.logout())
|
||||
ipcMain.handle('quit', async () => app.quit())
|
||||
ipcMain.handle('minimize', async () => win.minimize())
|
||||
ipcMain.handle('encode', async (event: IpcMainInvokeEvent, ...args: any[]) => {
|
||||
|
||||
@@ -34,7 +34,7 @@ export class InternalServer {
|
||||
});
|
||||
|
||||
router.get('/oauth', (ctx) => {
|
||||
if(process.env.VITE_DEV_SERVER_URL) {
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
ctx.body = fs.readFileSync(join(__dirname, '..', '..', 'public', 'callback.html'), {encoding: 'utf8'})
|
||||
} else {
|
||||
ctx.body = fs.readFileSync(join(process.env.DIST, 'callback.html'), {encoding: 'utf8'})
|
||||
|
||||
Reference in New Issue
Block a user