Merge remote-tracking branch 'upstream/dev'

This commit is contained in:
thororen 2024-05-12 17:41:38 -04:00
commit 992523682d
29 changed files with 392 additions and 194 deletions

View file

@ -420,6 +420,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "Kyuuhachi",
id: 236588665420251137n,
},
nin0dev: {
name: "nin0dev",
id: 886685857560539176n
},
Elvyra: {
name: "Elvyra",
id: 708275751816003615n,
@ -460,9 +464,17 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "Oleh Polisan",
id: 242305263313485825n
},
HAHALOSAH: {
name: "HAHALOSAH",
id: 903418691268513883n
},
GabiRP: {
name: "GabiRP",
id: 507955112027750401n
},
ImBanana: {
name: "Im_Banana",
id: 635250116688871425n
}
} satisfies Record<string, Dev>);

View file

@ -0,0 +1,24 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/**
* Recursively merges defaults into an object and returns the same object
* @param obj Object
* @param defaults Defaults
* @returns obj
*/
export function mergeDefaults<T>(obj: T, defaults: T): T {
for (const key in defaults) {
const v = defaults[key];
if (typeof v === "object" && !Array.isArray(v)) {
obj[key] ??= {} as any;
mergeDefaults(obj[key], v);
} else {
obj[key] ??= v;
}
}
return obj;
}

View file

@ -20,25 +20,6 @@ import { Clipboard, Toasts } from "@webpack/common";
import { DevsById, EquicordDevsById } from "./constants";
/**
* Recursively merges defaults into an object and returns the same object
* @param obj Object
* @param defaults Defaults
* @returns obj
*/
export function mergeDefaults<T>(obj: T, defaults: T): T {
for (const key in defaults) {
const v = defaults[key];
if (typeof v === "object" && !Array.isArray(v)) {
obj[key] ??= {} as any;
mergeDefaults(obj[key], v);
} else {
obj[key] ??= v;
}
}
return obj;
}
/**
* Calls .join(" ") on the arguments
* classes("one", "two") => "one two"

View file

@ -18,7 +18,7 @@
import { showNotification } from "@api/Notifications";
import { PlainSettings, Settings } from "@api/Settings";
import { Toasts } from "@webpack/common";
import { moment, Toasts } from "@webpack/common";
import { deflateSync, inflateSync } from "fflate";
import { getCloudAuth, getCloudUrl } from "./cloud";
@ -49,7 +49,7 @@ export async function exportSettings({ minify }: { minify?: boolean; } = {}) {
}
export async function downloadSettingsBackup() {
const filename = "vencord-settings-backup.json";
const filename = `vencord-settings-backup-${moment().format("YYYY-MM-DD")}.json`;
const backup = await exportSettings();
const data = new TextEncoder().encode(backup);