Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Commit

Permalink
Implements End of Support Notice
Browse files Browse the repository at this point in the history
  • Loading branch information
MasicoreLord authored and MasicoreLord committed Feb 10, 2021
1 parent 7bcae7d commit 0ce10c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dom_shit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');
const fs = require('fs');
const electron = require('electron');

electron.ipcRenderer.invoke('end-of-support-notice');

const mainProcessInfo = JSON.parse(electron.ipcRenderer.sendSync('main-process-info'));
const Module = require('module');
Module.globalPaths.push(mainProcessInfo.originalNodeModulesPath);
Expand Down Expand Up @@ -584,4 +586,4 @@ window.BdApi.Themes = new class AddonAPI {
reload() {}
get() {return null;}
getAll() {return [];}
};
};
25 changes: 24 additions & 1 deletion main_process_shit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,27 @@ ipcMain.handle('bd-navigate-page-listener', (event, arg) => {

ipcMain.handle('remove-bd-navigate-page-listener', (event, arg) => {
event.sender.getOwnerBrowserWindow().webContents.removeEventListener('did-navigate-in-page', arg);
})
})

ipcMain.handleOnce('end-of-support-notice', (event, arg) => {
const endOfSupportMessage = () => {
return electron.dialog.showMessageBoxSync(event.sender.getOwnerBrowserWindow(), {
type: 'info',
title: 'ED - End of Support Notice',
buttons: ['Help Me Uninstall', 'Continue Anyway', 'Quit'],
message: `EnhancedDiscord will end all support on February 28th, 2021.
Bug fixes only. (no more fixes for major discord updates)`,
cancelId: 1
});
};
switch(endOfSupportMessage()) {
case 0:
electron.shell.openExternal('https://github.com/joe27g/EnhancedDiscord/wiki/FAQ');
electron.app.quit();
break;
case 1:
break;
case 2:
electron.app.quit();
};
})

0 comments on commit 0ce10c5

Please sign in to comment.