[Splash > UI] Add version info in corner

This commit is contained in:
Ducko 2021-12-13 18:30:38 +00:00
parent 46f57c95f3
commit 9bd97701d5
3 changed files with 29 additions and 22 deletions

View file

@ -5,6 +5,8 @@
<div id="bar-container"></div>
<div id="bar-fill"></div>
<div id="debug"></div>
<style>
@font-face {
font-family: Whitney;
@ -82,6 +84,17 @@
transform: translate(0%, -50%);
left: 10%;
}
#debug {
position: absolute;
bottom: 6px;
right: 6px;
text-align: right;
font-size: 10px;
color: #72767d;
white-space: pre;
}
</style>
<script>
@ -107,4 +120,6 @@
barFill.style.display = '';
}
});
document.querySelector('#debug').textContent = DiscordSplash.getDebugInfo();
</script>

View file

@ -1,36 +1,28 @@
"use strict";
const { app, contextBridge, ipcRenderer } = require('electron');
const {
app,
contextBridge,
ipcRenderer
} = require('electron');
const { saferShellOpenExternal } = require('../utils/securityUtils');
const {
saferShellOpenExternal
} = require('../utils/securityUtils');
contextBridge.exposeInMainWorld('DiscordSplash', {
getReleaseChannel: () => {
const buildInfo = require('../utils/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');
quitDiscord: () => ipcRenderer.send('DISCORD_SPLASH_SCREEN_QUIT'),
getDebugInfo: () => {
const buildInfo = require('../utils/buildInfo');
const urlParams = new URLSearchParams(window.location.search);
return `${buildInfo.releaseChannel} ${buildInfo.version}
OpenAsar ${urlParams.get('oaVersion')}`;
}
});

View file

@ -487,7 +487,7 @@ function launchSplashWindow(startMinimized) {
pathname: _path.default.join(__dirname, 'index.html')
});
splashWindow.loadURL(splashUrl);
splashWindow.loadURL(splashUrl + '?oaVersion=' + global.oaVersion);
log('Splash', `Loading window (with url ${splashUrl})`);
}