Merge pull request #239578 from Scrumplex/vencord-disable-updater

vencord: Disable Updater
This commit is contained in:
Nick Cao 2023-06-25 12:18:22 +08:00 committed by GitHub
commit 1485d7bae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 6 deletions

View file

@ -36,6 +36,7 @@ buildNpmPackage rec {
npmDepsHash = "sha256-m+hczXog03Gz81CP/blkRJPaTrEhmLQFvVtOfWKYQL4=";
npmFlags = [ "--legacy-peer-deps" ];
npmBuildScript = if buildWebExtension then "buildWeb" else "build";
npmBuildFlags = [ "--" "--standalone" ];
prePatch = ''
cp ${./package-lock.json} ./package-lock.json
@ -46,13 +47,15 @@ buildNpmPackage rec {
src = ./replace-git.patch;
inherit version;
})
./disable-updater-ui.patch
];
installPhase = if buildWebExtension then ''
cp -r dist/chromium-unpacked/ $out
'' else ''
cp -r dist/ $out
'';
installPhase =
if buildWebExtension then ''
cp -r dist/chromium-unpacked/ $out
'' else ''
cp -r dist/ $out
'';
meta = with lib; {
description = "Vencord web extension";

View file

@ -0,0 +1,35 @@
diff --git a/src/components/VencordSettings/UpdaterTab.tsx b/src/components/VencordSettings/UpdaterTab.tsx
index 4d0b86c..0f1d87f 100644
--- a/src/components/VencordSettings/UpdaterTab.tsx
+++ b/src/components/VencordSettings/UpdaterTab.tsx
@@ -249,4 +249,4 @@ function Updater() {
);
}
-export default IS_WEB ? null : wrapTab(Updater, "Updater");
+export default null;
diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx
index 3ea5a43..da63213 100644
--- a/src/plugins/_core/settings.tsx
+++ b/src/plugins/_core/settings.tsx
@@ -105,7 +105,7 @@ export default definePlugin({
label: "Themes",
element: require("@components/VencordSettings/ThemesTab").default,
},
- !IS_WEB && {
+ false && !IS_WEB && {
section: "VencordUpdater",
label: "Updater",
element: require("@components/VencordSettings/UpdaterTab").default,
diff --git a/src/utils/updater.ts b/src/utils/updater.ts
index 2e2bfe1..5ebd06e 100644
--- a/src/utils/updater.ts
+++ b/src/utils/updater.ts
@@ -38,6 +38,7 @@ async function Unwrap<T>(p: Promise<IpcRes<T>>) {
}
export async function checkForUpdates() {
+ return false;
changes = await Unwrap(VencordNative.updater.getUpdates());
if (changes.some(c => c.hash === gitHash)) {
isNewer = true;

View file

@ -7,7 +7,7 @@ index 7ff599a..85b3bfa 100644
export const watch = process.argv.includes("--watch");
export const isStandalone = JSON.stringify(process.argv.includes("--standalone"));
-export const gitHash = execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim();
+export const gitHash = "@version@";
+export const gitHash = "v@version@";
export const banner = {
js: `
// Vencord ${gitHash}