aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/handleComponentFailed.ts31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/components/handleComponentFailed.ts b/src/components/handleComponentFailed.ts
index 020e8ef..43a3ad8 100644
--- a/src/components/handleComponentFailed.ts
+++ b/src/components/handleComponentFailed.ts
@@ -16,29 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { isOutdated, rebuild, update } from "@utils/updater";
+import { maybePromptToUpdate } from "@utils/updater";
-export async function handleComponentFailed() {
- if (isOutdated) {
- setImmediate(async () => {
- const wantsUpdate = confirm(
- "Uh Oh! Failed to render this Page." +
- " However, there is an update available that might fix it." +
- " Would you like to update and restart now?"
- );
- if (wantsUpdate) {
- try {
- await update();
- await rebuild();
- if (IS_WEB)
- location.reload();
- else
- DiscordNative.app.relaunch();
- } catch (e) {
- console.error(e);
- alert("That also failed :( Try updating or reinstalling with the installer!");
- }
- }
- });
- }
+export function handleComponentFailed() {
+ maybePromptToUpdate(
+ "Uh Oh! Failed to render this Page." +
+ " However, there is an update available that might fix it." +
+ " Would you like to update and restart now?"
+ );
}