[Splash] Rewrite config passing

main
Oj 2 years ago
parent a4280d4562
commit 199cf23a7a

@ -3,7 +3,7 @@ const { app, contextBridge, ipcRenderer } = require('electron');
const { saferShellOpenExternal } = require('../utils/securityUtils');
const urlParams = new URLSearchParams(window.location.search);
const oaConfig = JSON.parse(urlParams.get('oaConfig'));
contextBridge.exposeInMainWorld('DiscordSplash', {
signalReady: () => {
@ -20,7 +20,7 @@ contextBridge.exposeInMainWorld('DiscordSplash', {
quitDiscord: () => ipcRenderer.send('DISCORD_SPLASH_SCREEN_QUIT'),
getDebugInfo: () => {
if (urlParams.get('oaSplashText') === 'false') return '';
if (oaConfig.splashText === false) return '';
const buildInfo = require('../utils/buildInfo');
@ -28,7 +28,7 @@ contextBridge.exposeInMainWorld('DiscordSplash', {
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);
}) : {}
});

@ -493,7 +493,7 @@ function launchSplashWindow(startMinimized) {
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})`);
}

Loading…
Cancel
Save