caprine: 2.60.1 -> 2.60.3; disable autoUpdate (#361842)

This commit is contained in:
Nick Cao 2024-12-05 09:08:38 -05:00 committed by GitHub
commit 4c9ddcbc1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 3 deletions

View File

@ -0,0 +1,39 @@
From 5da393e32336534222c77659ff138a4e512e6a1f Mon Sep 17 00:00:00 2001
From: Austin Horstman <khaneliman12@gmail.com>
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;

View File

@ -6,22 +6,23 @@
makeDesktopItem,
copyDesktopItems,
electron,
nix-update-script,
}:
buildNpmPackage rec {
pname = "caprine";
version = "2.60.1";
version = "2.60.3";
src = fetchFromGitHub {
owner = "sindresorhus";
repo = "caprine";
rev = "v${version}";
hash = "sha256-y4W295i7FhgJC3SlwSr801fLOGJY1WF136bbkkBUvyw=";
hash = "sha256-yfCilJ62m7nKe8B+4puwAbNgr2g1P7HaKIhFINdv0/k=";
};
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
npmDepsHash = "sha256-JHaUc2p+wHsqWtls8xquHK9qnypuCrR0AQMGxcrTsC0=";
npmDepsHash = "sha256-hNOAplCSXrO4NZqDTkmhf0oZVeGRUHr2Y/Qdx2RIV9c=";
nativeBuildInputs = [ copyDesktopItems ];
@ -37,6 +38,8 @@ buildNpmPackage rec {
-c.electronVersion=${electron.version}
'';
patches = [ ./001-disable-auto-update.patch ];
installPhase = ''
runHook preInstall
@ -79,6 +82,8 @@ buildNpmPackage rec {
})
];
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/sindresorhus/caprine/releases/tag/${src.rev}";
description = "Elegant Facebook Messenger desktop app";