fix: Linter issues

This commit is contained in:
Angelos Bouklis 2023-04-10 00:10:42 +03:00 committed by GitHub
parent c5d93fc637
commit b27d9d72a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View file

@ -92,13 +92,13 @@ export function getUserTimezone(discordID: string, strategy: CustomTimezonePrefe
return new Promise(res => { return new Promise(res => {
const timezone = (DataStore.get(DATASTORE_KEY) as Promise<TimezoneDB | undefined>).then(tzs => tzs?.[discordID]); const timezone = (DataStore.get(DATASTORE_KEY) as Promise<TimezoneDB | undefined>).then(tzs => tzs?.[discordID]);
timezone.then(tz => { timezone.then(tz => {
if (strategy == CustomTimezonePreference.Always) { if (strategy === CustomTimezonePreference.Always) {
if (tz) res(tz); if (tz) res(tz);
else res(undefined); else res(undefined);
return; return;
} }
if (tz && strategy == CustomTimezonePreference.Secondary) if (tz && strategy === CustomTimezonePreference.Secondary)
res(tz); res(tz);
else { else {
if (discordID in Cache) res(Cache[discordID]); if (discordID in Cache) res(Cache[discordID]);
@ -121,7 +121,7 @@ export const getAllTimezones = async (): Promise<string[]> => {
if (typeof Intl !== "undefined" && "supportedValuesOf" in Intl) { if (typeof Intl !== "undefined" && "supportedValuesOf" in Intl) {
try { try {
// @ts-expect-error fuck you typescript // @ts-expect-error fuck you typescript
return Intl.supportedValuesOf('timeZone'); return Intl.supportedValuesOf("timeZone");
} catch { } } catch { }
} }

View file

@ -1,3 +1,21 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2022 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { definePluginSettings } from "@api/settings"; import { definePluginSettings } from "@api/settings";
import { OptionType } from "@utils/types"; import { OptionType } from "@utils/types";