[Bugfix] Fix forced Hindi timestamps
This commit is contained in:
parent
293c256dc9
commit
2201ff3a1d
6 changed files with 38 additions and 42 deletions
|
@ -1,28 +0,0 @@
|
|||
// Based on https://github.com/Aliucord/AliucordRN/blob/main/src/ui/patchTheme.ts
|
||||
// Literally could not figure this out, many thanks
|
||||
|
||||
import { FluxDispatcher } from "@metro/common";
|
||||
import { findByProps, findByStoreName } from "@metro/filters";
|
||||
import logger from "@lib/logger";
|
||||
|
||||
// TODO: Move these to common modules?
|
||||
const ThemeManager = findByProps("updateTheme", "overrideTheme");
|
||||
const AMOLEDThemeManager = findByProps("setAMOLEDThemeEnabled");
|
||||
const ThemeStore = findByStoreName("ThemeStore");
|
||||
const UnsyncedUserSettingsStore = findByStoreName("UnsyncedUserSettingsStore");
|
||||
|
||||
function override() {
|
||||
const theme = ThemeStore.theme || "dark";
|
||||
ThemeManager.overrideTheme(theme);
|
||||
|
||||
if (AMOLEDThemeManager && UnsyncedUserSettingsStore.useAMOLEDTheme === 2) AMOLEDThemeManager.setAMOLEDThemeEnabled(true);
|
||||
FluxDispatcher.unsubscribe("I18N_LOAD_START", override);
|
||||
}
|
||||
|
||||
export default function fixTheme() {
|
||||
try {
|
||||
if (ThemeStore) FluxDispatcher.subscribe("I18N_LOAD_START", override);
|
||||
} catch(e) {
|
||||
logger.error("Failed to fix theme...", e)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue