mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
desktop: auto check for updates every 12 hours
This commit is contained in:
committed by
Abdullah Atta
parent
bd29f4e9e2
commit
8e8581cce5
@@ -21,6 +21,7 @@ import { createTRPCProxyClient } from "@trpc/client";
|
||||
import { ipcLink } from "electron-trpc/renderer";
|
||||
import type { AppRouter } from "@notesnook/desktop";
|
||||
import { AppEventManager, AppEvents } from "../app-events";
|
||||
import { TaskScheduler } from "../../utils/task-scheduler";
|
||||
import { checkForUpdate } from "../../utils/updater";
|
||||
|
||||
export const desktop = createTRPCProxyClient<AppRouter>({
|
||||
@@ -57,6 +58,10 @@ document.addEventListener("readystatechange", async () => {
|
||||
undefined,
|
||||
attachListener(AppEvents.updateError)
|
||||
);
|
||||
|
||||
TaskScheduler.register("updateCheck", "0 0 */12 * * * *", () => {
|
||||
checkForUpdate();
|
||||
});
|
||||
});
|
||||
|
||||
function attachListener(event: string) {
|
||||
|
||||
Reference in New Issue
Block a user