mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
auto-update
This commit is contained in:
@@ -46,7 +46,10 @@ if (electronIsDev) {
|
||||
// Initialize our app, build windows, and load content.
|
||||
await myCapacitorApp.init();
|
||||
// Check for updates if we are in a packaged app.
|
||||
// autoUpdater.checkForUpdatesAndNotify();
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
setInterval(() => {
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
}, 6 * 60 * 60 * 1000); // 24 hours in milliseconds
|
||||
})();
|
||||
|
||||
// Handle when all of our windows are close (platforms have their own expectations).
|
||||
|
@@ -2,8 +2,14 @@ require('./rt/electron-rt');
|
||||
//////////////////////////////
|
||||
// User Defined Preload scripts below
|
||||
console.log('User Preload!');
|
||||
const { contextBridge, shell } = require('electron');
|
||||
const { contextBridge, shell, ipcRenderer } = require('electron');
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
openExternal: (url) => shell.openExternal(url)
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld('electron', {
|
||||
onUpdateAvailable: (callback) => ipcRenderer.on('update_available', callback),
|
||||
onUpdateDownloaded: (callback) => ipcRenderer.on('update_downloaded', callback),
|
||||
restartApp: () => ipcRenderer.send('restart_app')
|
||||
});
|
Reference in New Issue
Block a user