[Patcher > Index] Try wrap each patcher module for more reliability

pull/70/head
Oj 2 years ago
parent c7bdaf5021
commit 6e1ed14898

@ -108,7 +108,7 @@ const init = async function () {
try {
await x(this);
} catch (e) {
console.warn('[GooseMod] Failed to scopeset', e, x);
console.error('[GooseMod] Failed to scopeset', e, x);
}
}

@ -24,14 +24,11 @@ export const username = _username;
export const guildBadges = _guildBadges;
export const setThisScope = (scope) => {
_contextMenu.setThisScope(scope);
_miniPopover.setThisScope(scope);
_channelTextAreaButtons.setThisScope(scope);
_commands.setThisScope(scope);
_internalMessage.setThisScope(scope);
_notices.setThisScope(scope);
_headerBarButtons.setThisScope(scope);
_userBadges.setThisScope(scope);
_username.setThisScope(scope);
_guildBadges.setThisScope(scope);
for (const fn of [ _contextMenu.setThisScope, _miniPopover.setThisScope, _channelTextAreaButtons.setThisScope, _commands.setThisScope, _internalMessage.setThisScope, _notices.setThisScope, _headerBarButtons.setThisScope, _userBadges.setThisScope, _username.setThisScope, _guildBadges.setThisScope ]) {
try {
fn(scope);
} catch (e) {
console.error('[GooseMod] Failed to scope patcher module', e, fn);
}
}
};
Loading…
Cancel
Save