[Settings] Fix awaiting fully for new Canary

pull/67/head
Oj18 2 years ago
parent a9af9536f4
commit caf6deb193

@ -100,9 +100,9 @@ const init = async function () {
this.cssCache.load();
while ((window.webpackJsonp === undefined && window.webpackChunkdiscord_app === undefined)) {
await sleep(10);
await sleep(50);
}
while (!this.webpackModules.findByDisplayName('SettingsView')?.prototype) await sleep(10);
while (!this.webpackModules.findByDisplayName('Clickable')) await sleep(50);
for (let x of scopeSetterFncs) {
try {

@ -152,7 +152,11 @@ export const makeGooseModSettings = () => {
addToContextMenu(goosemodScope, gmSettings.home);
if (gmSettings.home) addToHome(goosemodScope);
loadColorPicker();
try {
loadColorPicker();
} catch (e) {
goosemodScope.logger.debug('Failed to load color picker');
}
};
const loadColorPicker = () => { // Force load ColorPicker as it's dynamically loaded

@ -1,7 +1,9 @@
import sleep from '../../util/sleep';
export default async (goosemodScope, gmSettings) => {
const SettingsView = goosemodScope.webpackModules.findByDisplayName('SettingsView');
let SettingsView;
while (!(SettingsView = goosemodScope.webpackModules.findByDisplayName('SettingsView'))) await sleep(50);
const Text = goosemodScope.webpackModules.findByDisplayName('Text');
const VersionClasses = goosemodScope.webpackModules.findByProps('versionHash', 'line');

Loading…
Cancel
Save