0.1.8
This commit is contained in:
parent
fb3f3c5b5b
commit
5b140448b2
|
@ -41,7 +41,7 @@ module.exports = (() => {
|
||||||
twitter_username: ''
|
twitter_username: ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
version: '0.1.7',
|
version: '0.1.8',
|
||||||
description: 'In the event that your Discord crashes, the plugin enables you to get Discord back to a working state, without needing to reload at all.',
|
description: 'In the event that your Discord crashes, the plugin enables you to get Discord back to a working state, without needing to reload at all.',
|
||||||
github: 'https://github.com/1Lighty',
|
github: 'https://github.com/1Lighty',
|
||||||
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/CrashRecovery/CrashRecovery.plugin.js'
|
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/CrashRecovery/CrashRecovery.plugin.js'
|
||||||
|
@ -50,7 +50,7 @@ module.exports = (() => {
|
||||||
{
|
{
|
||||||
title: 'fixed',
|
title: 'fixed',
|
||||||
type: 'fixed',
|
type: 'fixed',
|
||||||
items: ['Changed to module.exports because useless backwards incompatbile changes are the motto for BBD apparently.']
|
items: ['Crash fix.']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
defaultConfig: [
|
defaultConfig: [
|
||||||
|
@ -72,6 +72,8 @@ module.exports = (() => {
|
||||||
const DelayedCall = (WebpackModules.getByProps('DelayedCall') || {}).DelayedCall;
|
const DelayedCall = (WebpackModules.getByProps('DelayedCall') || {}).DelayedCall;
|
||||||
const ElectronDiscordModule = WebpackModules.getByProps('cleanupDisplaySleep') || { cleanupDisplaySleep: DiscordModules.DiscordConstants.NOOP };
|
const ElectronDiscordModule = WebpackModules.getByProps('cleanupDisplaySleep') || { cleanupDisplaySleep: DiscordModules.DiscordConstants.NOOP };
|
||||||
|
|
||||||
|
const ModalStack = WebpackModules.getByProps('openModal');
|
||||||
|
|
||||||
return class CrashRecovery extends Plugin {
|
return class CrashRecovery extends Plugin {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
@ -166,12 +168,36 @@ module.exports = (() => {
|
||||||
cleanupDiscord() {
|
cleanupDiscord() {
|
||||||
ElectronDiscordModule.cleanupDisplaySleep();
|
ElectronDiscordModule.cleanupDisplaySleep();
|
||||||
Dispatcher.wait(() => {
|
Dispatcher.wait(() => {
|
||||||
DiscordModules.ContextMenuActions.closeContextMenu();
|
try {
|
||||||
DiscordModules.ModalStack.popAll();
|
DiscordModules.ContextMenuActions.closeContextMenu();
|
||||||
DiscordModules.LayerManager.popAllLayers();
|
} catch (err) {
|
||||||
DiscordModules.PopoutStack.closeAll();
|
Logger.stacktrace('Failed to close all context menus', err);
|
||||||
WebpackModules.getByProps('openModal').modalsApi.setState(() => ({ default: [] })); /* slow? unsafe? async? */
|
}
|
||||||
if (!this.settings.useThirdStep) DiscordModules.NavigationUtils.transitionTo('/channels/@me');
|
try {
|
||||||
|
DiscordModules.ModalStack.popAll();
|
||||||
|
} catch (err) {
|
||||||
|
Logger.stacktrace('Failed to pop old modalstack', err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
DiscordModules.LayerManager.popAllLayers();
|
||||||
|
} catch (err) {
|
||||||
|
Logger.stacktrace('Failed to pop all layers', err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
DiscordModules.PopoutStack.closeAll();
|
||||||
|
} catch (err) {
|
||||||
|
Logger.stacktrace('Failed to close all popouts', err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
(ModalStack.modalsApi || ModalStack.useModalsStore).setState(() => ({ default: [] })); /* slow? unsafe? async? */
|
||||||
|
} catch (err) {
|
||||||
|
Logger.stacktrace('Failed to pop new modalstack');
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (!this.settings.useThirdStep) DiscordModules.NavigationUtils.transitionTo('/channels/@me');
|
||||||
|
} catch (err) {
|
||||||
|
Logger.stacktrace('Failed to transition to home');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue