From 624f1f34f93d49af20b96aefb66ece3e50833664 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 4 Dec 2024 13:24:42 -0600 Subject: [PATCH] caprine: disable autoUpdate functionality We can't auto update so just disable that functionality. --- .../ca/caprine/001-disable-auto-update.patch | 39 +++++++++++++++++++ pkgs/by-name/ca/caprine/package.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/by-name/ca/caprine/001-disable-auto-update.patch diff --git a/pkgs/by-name/ca/caprine/001-disable-auto-update.patch b/pkgs/by-name/ca/caprine/001-disable-auto-update.patch new file mode 100644 index 000000000000..f26fc35690c0 --- /dev/null +++ b/pkgs/by-name/ca/caprine/001-disable-auto-update.patch @@ -0,0 +1,39 @@ +From 5da393e32336534222c77659ff138a4e512e6a1f Mon Sep 17 00:00:00 2001 +From: Austin Horstman +Date: Wed, 4 Dec 2024 13:23:15 -0600 +Subject: [PATCH] Disable autoUpdate + +--- + source/index.ts | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/source/index.ts b/source/index.ts +index b8511949a..205c513fe 100644 +--- a/source/index.ts ++++ b/source/index.ts +@@ -14,7 +14,6 @@ import { + nativeTheme, + } from 'electron'; + import {ipcMain as ipc} from 'electron-better-ipc'; +-import {autoUpdater} from 'electron-updater'; + import electronDl from 'electron-dl'; + import electronContextMenu from 'electron-context-menu'; + import electronLocalshortcut from 'electron-localshortcut'; +@@ -65,17 +64,6 @@ if (!config.get('hardwareAcceleration')) { + app.disableHardwareAcceleration(); + } + +-if (!is.development && config.get('autoUpdate')) { +- (async () => { +- const FOUR_HOURS = 1000 * 60 * 60 * 4; +- setInterval(async () => { +- await autoUpdater.checkForUpdatesAndNotify(); +- }, FOUR_HOURS); +- +- await autoUpdater.checkForUpdatesAndNotify(); +- })(); +-} +- + let mainWindow: BrowserWindow; + let isQuitting = false; + let previousMessageCount = 0; diff --git a/pkgs/by-name/ca/caprine/package.nix b/pkgs/by-name/ca/caprine/package.nix index 7efa27ec3aaa..17d78ba28d9b 100644 --- a/pkgs/by-name/ca/caprine/package.nix +++ b/pkgs/by-name/ca/caprine/package.nix @@ -38,6 +38,8 @@ buildNpmPackage rec { -c.electronVersion=${electron.version} ''; + patches = [ ./001-disable-auto-update.patch ]; + installPhase = '' runHook preInstall