add.[ALL]
This commit is contained in:
parent
5ac24c8cea
commit
780ad9a200
54 changed files with 3733 additions and 0 deletions
33
.resources/app/app_bootstrap/splashScreenPreload.js
Normal file
33
.resources/app/app_bootstrap/splashScreenPreload.js
Normal 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');
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue