stuff
This commit is contained in:
parent
f60c86cd35
commit
e4cde8738e
|
@ -8652,14 +8652,6 @@ module.exports = (_ => {
|
|||
if (InternalData.ModuleUtilsConfig.QueuedComponents) for (let type of InternalData.ModuleUtilsConfig.QueuedComponents) if (!PluginStores.patchQueues[type]) PluginStores.patchQueues[type] = {query: [], modules: []};
|
||||
|
||||
let languageChangeTimeout;
|
||||
BDFDB.PatchUtils.patch(BDFDB, Internal.LibraryModules.SettingsUtilsOld, ["updateRemoteSettings", "updateLocalSettings"], {after: e => {
|
||||
if (e.methodArguments[0] && e.methodArguments[0].locale) {
|
||||
BDFDB.TimeUtils.clear(languageChangeTimeout);
|
||||
languageChangeTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
for (let pluginName in PluginStores.loaded) if (PluginStores.loaded[pluginName].started) BDFDB.PluginUtils.translate(PluginStores.loaded[pluginName]);
|
||||
}, 10000);
|
||||
}
|
||||
}});
|
||||
BDFDB.PatchUtils.patch(BDFDB, Internal.LibraryModules.AppearanceSettingsUtils, "updateLocale", {after: e => {
|
||||
BDFDB.TimeUtils.clear(languageChangeTimeout);
|
||||
languageChangeTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
"RoleIconUtils": {"props": ["getRoleIconData"]},
|
||||
"SearchPageUtils": {"props": ["searchNextPage", "searchPreviousPage"]},
|
||||
"SettingsUtils": {"props": ["ShowCurrentGame", "DeveloperMode"]},
|
||||
"SettingsUtilsOld": {"props": ["updateRemoteSettings", "updateLocalSettings"]},
|
||||
"SimpleMarkdownComponents": {"strings": ["customEmoji", "emojiTooltipPosition", "timestampTooltip"]},
|
||||
"SimpleMarkdownParser": {"props": ["parseBlock", "parseInline", "defaultOutput"]},
|
||||
"SlateDraftUtils": {"props": ["getRecentlyEditedDrafts", "getDraft"]},
|
||||
|
|
|
@ -8652,14 +8652,6 @@ module.exports = (_ => {
|
|||
if (InternalData.ModuleUtilsConfig.QueuedComponents) for (let type of InternalData.ModuleUtilsConfig.QueuedComponents) if (!PluginStores.patchQueues[type]) PluginStores.patchQueues[type] = {query: [], modules: []};
|
||||
|
||||
let languageChangeTimeout;
|
||||
BDFDB.PatchUtils.patch(BDFDB, Internal.LibraryModules.SettingsUtilsOld, ["updateRemoteSettings", "updateLocalSettings"], {after: e => {
|
||||
if (e.methodArguments[0] && e.methodArguments[0].locale) {
|
||||
BDFDB.TimeUtils.clear(languageChangeTimeout);
|
||||
languageChangeTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
for (let pluginName in PluginStores.loaded) if (PluginStores.loaded[pluginName].started) BDFDB.PluginUtils.translate(PluginStores.loaded[pluginName]);
|
||||
}, 10000);
|
||||
}
|
||||
}});
|
||||
BDFDB.PatchUtils.patch(BDFDB, Internal.LibraryModules.AppearanceSettingsUtils, "updateLocale", {after: e => {
|
||||
BDFDB.TimeUtils.clear(languageChangeTimeout);
|
||||
languageChangeTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
|
|
|
@ -83,16 +83,6 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
onStart () {
|
||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SettingsUtilsOld, "updateLocalSettings", {after: e => {
|
||||
if (BDFDB.ObjectUtils.is(e.methodArguments[0]) && e.methodArguments[0].theme && settings.running) {
|
||||
BDFDB.TimeUtils.clear(changeTimeout);
|
||||
disableChanging = true;
|
||||
changeTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
disableChanging = false;
|
||||
}, 1000*60*10);
|
||||
}
|
||||
}});
|
||||
|
||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.AppearanceSettingsUtils, "updateTheme", {after: e => {
|
||||
if (settings.running) {
|
||||
BDFDB.TimeUtils.clear(changeTimeout);
|
||||
|
@ -184,7 +174,7 @@ module.exports = (_ => {
|
|||
let theme = BDFDB.DiscordUtils.getTheme(), newTheme = null;
|
||||
if (dark && theme == BDFDB.disCN.themelight) newTheme = "dark";
|
||||
else if (!dark && theme == BDFDB.disCN.themedark) newTheme = "light";
|
||||
if (newTheme) BDFDB.LibraryModules.SettingsUtilsOld && BDFDB.LibraryModules.SettingsUtilsOld.updateLocalSettings({theme: newTheme}) || BDFDB.LibraryModules.AppearanceSettingsUtils.updateTheme(newTheme);
|
||||
if (newTheme) BDFDB.LibraryModules.AppearanceSettingsUtils.updateTheme(newTheme);
|
||||
}
|
||||
|
||||
showCurrentTime (grabber) {
|
||||
|
|
Loading…
Reference in New Issue