[Splash] Rewrite config passing
This commit is contained in:
parent
a4280d4562
commit
199cf23a7a
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ const { app, contextBridge, ipcRenderer } = require('electron');
|
||||||
const { saferShellOpenExternal } = require('../utils/securityUtils');
|
const { saferShellOpenExternal } = require('../utils/securityUtils');
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const oaConfig = JSON.parse(urlParams.get('oaConfig'));
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld('DiscordSplash', {
|
contextBridge.exposeInMainWorld('DiscordSplash', {
|
||||||
signalReady: () => {
|
signalReady: () => {
|
||||||
|
@ -20,7 +20,7 @@ contextBridge.exposeInMainWorld('DiscordSplash', {
|
||||||
quitDiscord: () => ipcRenderer.send('DISCORD_SPLASH_SCREEN_QUIT'),
|
quitDiscord: () => ipcRenderer.send('DISCORD_SPLASH_SCREEN_QUIT'),
|
||||||
|
|
||||||
getDebugInfo: () => {
|
getDebugInfo: () => {
|
||||||
if (urlParams.get('oaSplashText') === 'false') return '';
|
if (oaConfig.splashText === false) return '';
|
||||||
|
|
||||||
const buildInfo = require('../utils/buildInfo');
|
const buildInfo = require('../utils/buildInfo');
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ contextBridge.exposeInMainWorld('DiscordSplash', {
|
||||||
OpenAsar ${urlParams.get('oaVersion')}`;
|
OpenAsar ${urlParams.get('oaVersion')}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
getCSS: callback => urlParams.get('oaThemeSync') !== 'false' ? ipcRenderer.on('DISCORD_GET_CSS', (_, value) => {
|
getCSS: callback => oaConfig.themeSync !== 'false' ? ipcRenderer.on('DISCORD_GET_CSS', (_, value) => {
|
||||||
callback(value);
|
callback(value);
|
||||||
}) : {}
|
}) : {}
|
||||||
});
|
});
|
|
@ -493,7 +493,7 @@ function launchSplashWindow(startMinimized) {
|
||||||
log('Splash', 'Failed to inject splash CSS');
|
log('Splash', 'Failed to inject splash CSS');
|
||||||
}
|
}
|
||||||
|
|
||||||
splashWindow.loadURL(splashUrl + '?oaVersion=' + global.oaVersion + '&oaThemeSync=' + oaConfig.themeSync + '&oaSplashText' + oaConfig.splashText);
|
splashWindow.loadURL(splashUrl + '?oaVersion=' + global.oaVersion + '&oaConfig=' + JSON.stringify(oaConfig));
|
||||||
|
|
||||||
log('Splash', `Loading window (with url ${splashUrl})`);
|
log('Splash', `Loading window (with url ${splashUrl})`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue