Compare commits
No commits in common. "beac26ed4f9f14bea3be09c5e8dfd974f7e996ef" and "c5efe6b86196b4802cfa3b0bd24eb2fd6aee25a9" have entirely different histories.
beac26ed4f
...
c5efe6b861
|
|
@ -1,17 +1,11 @@
|
||||||
import { app, shell, BrowserWindow, ipcMain, Notification } from 'electron'
|
import { app, shell, BrowserWindow, ipcMain } from 'electron'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||||
import icon from '../../resources/icon.png?asset'
|
import icon from '../../resources/icon.png?asset'
|
||||||
import { autoUpdater } from 'electron-updater'
|
|
||||||
|
|
||||||
autoUpdater.autoDownload = false;
|
|
||||||
autoUpdater.autoInstallOnAppQuit = true;
|
|
||||||
|
|
||||||
let mainWindow;
|
|
||||||
function createWindow(): void {
|
function createWindow(): void {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
// const mainWindow = new BrowserWindow({
|
const mainWindow = new BrowserWindow({
|
||||||
mainWindow = new BrowserWindow({
|
|
||||||
width: 900,
|
width: 900,
|
||||||
height: 670,
|
height: 670,
|
||||||
show: false,
|
show: false,
|
||||||
|
|
@ -60,8 +54,6 @@ app.whenReady().then(() => {
|
||||||
|
|
||||||
createWindow()
|
createWindow()
|
||||||
|
|
||||||
checkForUpdates();
|
|
||||||
|
|
||||||
app.on('activate', function () {
|
app.on('activate', function () {
|
||||||
// On macOS it's common to re-create a window in the app when the
|
// On macOS it's common to re-create a window in the app when the
|
||||||
// dock icon is clicked and there are no other windows open.
|
// dock icon is clicked and there are no other windows open.
|
||||||
|
|
@ -78,39 +70,5 @@ app.on('window-all-closed', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function checkForUpdates() {
|
// In this file you can include the rest of your app's specific main process
|
||||||
autoUpdater.checkForUpdates();
|
// code. You can also put them in separate files and require them here.
|
||||||
console.log(`Checking for updates. Current version ${app.getVersion()}`);
|
|
||||||
showNotification(`Checking for updates. Current version ${app.getVersion()}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showNotification(value: any) {
|
|
||||||
new Notification({
|
|
||||||
title: value,
|
|
||||||
}).show()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*New Update Available*/
|
|
||||||
autoUpdater.on("update-available", (info) => {
|
|
||||||
console.log(`Update available. Current version ${app.getVersion()}`);
|
|
||||||
showNotification(`Update available. Current version ${app.getVersion()}`);
|
|
||||||
let pth = autoUpdater.downloadUpdate();
|
|
||||||
console.log(pth);
|
|
||||||
showNotification(pth);
|
|
||||||
});
|
|
||||||
|
|
||||||
autoUpdater.on("update-not-available", (info) => {
|
|
||||||
console.log(`No update available. Current version ${app.getVersion()}`);
|
|
||||||
showNotification(`No update available. Current version ${app.getVersion()}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
/*Download Completion Message*/
|
|
||||||
autoUpdater.on("update-downloaded", (info) => {
|
|
||||||
console.log(`Update downloaded. Current version ${app.getVersion()}`);
|
|
||||||
showNotification(`Update downloaded. Current version ${app.getVersion()}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
autoUpdater.on("error", (info) => {
|
|
||||||
console.log(info);
|
|
||||||
showNotification(info);
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ function App(): React.JSX.Element {
|
||||||
|
|
||||||
const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')
|
const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')
|
||||||
|
|
||||||
const { t } = useTranslation()
|
const { t, i18n } = useTranslation()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ console.log("config.ts")
|
||||||
i18n.use(Backend).use(LanguageDetector).use(initReactI18next).init({
|
i18n.use(Backend).use(LanguageDetector).use(initReactI18next).init({
|
||||||
// resources,
|
// resources,
|
||||||
backend: {
|
backend: {
|
||||||
loadPath: './locales/{{lng}}/{{ns}}.json',
|
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||||
addPath: './locales/{{lng}}/{{ns}}.missing.json',
|
addPath: '/locales/{{lng}}/{{ns}}.missing.json',
|
||||||
contextBridgeApiKey: "api"
|
contextBridgeApiKey: "api"
|
||||||
},
|
},
|
||||||
lng: 'en',
|
lng: 'en',
|
||||||
|
|
|
||||||
Reference in a new issue