add.[ALL]

This commit is contained in:
|| Prof. - Xadk3!#0000 || @naryal2580 2023-05-21 16:28:12 +05:30
parent 5ac24c8cea
commit 780ad9a200
54 changed files with 3733 additions and 0 deletions

View file

@ -0,0 +1,33 @@
"use strict";
const {
app,
contextBridge,
ipcRenderer
} = require('electron');
const {
saferShellOpenExternal
} = require('../common/securityUtils');
contextBridge.exposeInMainWorld('DiscordSplash', {
getReleaseChannel: () => {
const buildInfo = require('./buildInfo');
return buildInfo.releaseChannel;
},
signalReady: () => {
ipcRenderer.send('DISCORD_SPLASH_SCREEN_READY');
},
onStateUpdate: callback => {
ipcRenderer.on('DISCORD_SPLASH_UPDATE_STATE', (_, state) => {
callback(state);
});
},
onQuoteUpdate: callback => {
ipcRenderer.on('DISCORD_SPLASH_SCREEN_QUOTE', (_, quote) => {
callback(quote);
});
},
openUrl: saferShellOpenExternal,
quitDiscord: () => {
ipcRenderer.send('DISCORD_SPLASH_SCREEN_QUIT');
}
});