[Metro] Get language on search instead

This commit is contained in:
Beef 2022-10-18 23:14:01 +01:00
parent 7ec0c3c82d
commit ae616da565

View file

@ -27,13 +27,13 @@ for (const key in window.modules) {
}
}
// Get the previous moment locale
const previousLocale = moment?.locale();
// Function to filter through modules
export const filterModules = (modules: MetroModules, single = false) => (filter: (m: any) => boolean) => {
const found = [];
// Get the previous moment locale
const previousLocale = moment?.locale();
for (const key in modules) {
const id = Number(key);
const module = modules[id].publicModule.exports;
@ -41,7 +41,7 @@ export const filterModules = (modules: MetroModules, single = false) => (filter:
if (!modules[id].isInitialized) try {
__r(id);
// Set moment locale, sort of crappy fix but works I guess
if (previousLocale) moment.locale(previousLocale);
if (previousLocale && previousLocale !== moment.locale()) moment.locale(previousLocale);
} catch {};
if (!module) {