Skip to content

Commit

Permalink
🐛 fix release date display
Browse files Browse the repository at this point in the history
  • Loading branch information
Doccrazy committed Apr 4, 2023
1 parent c975ad9 commit e6004f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ async function createMainWindow(reopen?: boolean) {
};
const config: Splashscreen.Config = {
windowOpts: mainOpts,
templateUrl: `${__dirname}/splash-screen.html`,
templateUrl: `${__dirname}/splash-screen.html?appVersion=${app.getVersion()}&buildDate=${(typeof BUILD_DATE === 'undefined'
? new Date()
: new Date(BUILD_DATE)
).toISOString()}`,
delay: 250,
splashScreenOpts: {
width: 575,
Expand All @@ -122,7 +125,6 @@ async function createMainWindow(reopen?: boolean) {
}
};
const splash = Splashscreen.initDynamicSplashScreen(config);
(splash.splashScreen as any).buildDate = typeof BUILD_DATE === 'undefined' ? new Date() : new Date(BUILD_DATE);
mainWindow = splash.main;

remote.enable(mainWindow.webContents);
Expand Down
4 changes: 2 additions & 2 deletions app/splash-screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
<div id="version">Version 1.2.3</div>
</div>
<script>
const version = require('electron').remote.app.getVersion();
const buildDate = require('electron').remote.getCurrentWindow().buildDate.toLocaleString(undefined, { year: 'numeric', month: '2-digit', day: '2-digit' });
const version = new URLSearchParams(location.search).get('appVersion');
const buildDate = new Date(new URLSearchParams(location.search).get('buildDate')).toLocaleString(undefined, { year: 'numeric', month: '2-digit', day: '2-digit' });
document.getElementById('version').innerText = 'v' + version + ' built ' + buildDate;
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import GitRevisionPlugin from 'git-revision-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';
// import { dependencies as externals } from './app/package.json';

const gitRevisionPlugin = new GitRevisionPlugin();
const gitRevisionPlugin = new GitRevisionPlugin({ lightweightTags: true });

const baseConfig: Configuration = {
// externals: Object.keys(externals || {}),
Expand Down

0 comments on commit e6004f8

Please sign in to comment.