This commit is contained in:
Mirco Wittrien 2022-08-18 08:36:12 +02:00
parent f60c86cd35
commit e4cde8738e
4 changed files with 1 additions and 28 deletions

View File

@ -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(_ => {

View File

@ -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"]},

View File

@ -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(_ => {

View File

@ -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) {