Fix startup bug for folder users

This commit is contained in:
Zack Rauen 2021-04-16 19:28:34 -04:00
parent 2ace4925a2
commit 97f89898ab
1 changed files with 3 additions and 2 deletions

View File

@ -41,6 +41,7 @@ export default new class Core {
if (window.ED) return Modals.alert(Strings.Startup.notSupported, Strings.Startup.incompatibleApp.format({app: "EnhancedDiscord"})); if (window.ED) return Modals.alert(Strings.Startup.notSupported, Strings.Startup.incompatibleApp.format({app: "EnhancedDiscord"}));
if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes("Patched")) return Modals.alert(Strings.Startup.notSupported, Strings.Startup.incompatibleApp.format({app: "Powercord"})); if (window.WebSocket && window.WebSocket.name && window.WebSocket.name.includes("Patched")) return Modals.alert(Strings.Startup.notSupported, Strings.Startup.incompatibleApp.format({app: "Powercord"}));
Logger.log("Startup", "Getting update information");
this.checkForUpdate(); this.checkForUpdate();
Logger.log("Startup", "Initializing Settings"); Logger.log("Startup", "Initializing Settings");
@ -94,8 +95,7 @@ export default new class Core {
if (document.readyState != "complete") setTimeout(checkForGuilds, 100); if (document.readyState != "complete") setTimeout(checkForGuilds, 100);
const wrapper = GuildClasses.wrapper.split(" ")[0]; const wrapper = GuildClasses.wrapper.split(" ")[0];
const guild = GuildClasses.listItem.split(" ")[0]; const guild = GuildClasses.listItem.split(" ")[0];
const blob = GuildClasses.blobContainer.split(" ")[0]; if (document.querySelectorAll(`.${wrapper} .${guild}`).length > 0) return resolve();
if (document.querySelectorAll(`.${wrapper} .${guild} .${blob}`).length > 0) return resolve();
setTimeout(checkForGuilds, 100); setTimeout(checkForGuilds, 100);
}; };
@ -119,6 +119,7 @@ export default new class Core {
const hasUpdate = remoteVersion > Config.version; const hasUpdate = remoteVersion > Config.version;
if (!hasUpdate) return; if (!hasUpdate) return;
// TODO: move to strings file when updater is complete.
Modals.showConfirmationModal("Update Available", `BetterDiscord (${Config.version}) has an available update available (${remoteVersion}). Would you like to update now?`, { Modals.showConfirmationModal("Update Available", `BetterDiscord (${Config.version}) has an available update available (${remoteVersion}). Would you like to update now?`, {
confirmText: "Update", confirmText: "Update",
cancelText: "Skip", cancelText: "Skip",