Skip to content

Commit e874067

Browse files
committed
Improve standalone version indicator
1 parent 8f8bb85 commit e874067

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/build/version-loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module.exports = () => {
22
if (process.env.STANDALONE) {
33
const now = new Date();
4-
return `export default ${JSON.stringify(`${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`)};`;
4+
const dateString = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
5+
return `export default ${JSON.stringify(`Standalone version (${dateString})`)}`;
56
}
67
return `export default null;`;
78
};

src/p4/P4.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Progress from './Progress.svelte';
1010
import Modals from './Modals.svelte';
1111
import {progress, theme} from './stores';
12-
import {isSupported, isSafari, isStandalone} from './environment';
12+
import {isSupported, isSafari} from './environment';
1313
import version from '../build/version-loader!';
1414
import {LONG_NAME, FEEDBACK_GITHUB, FEEDBACK_SCRATCH, SOURCE_CODE} from '../packager/brand';
1515
@@ -109,8 +109,8 @@
109109
<Section accent="#ff4c4c">
110110
<div>
111111
<h1>{LONG_NAME}</h1>
112-
{#if isStandalone}
113-
<p><i>Standalone version ({version})</i></p>
112+
{#if version}
113+
<p><i>{version}</i></p>
114114
{/if}
115115
<p>{$_('p4.description1')}</p>
116116
<p>

0 commit comments

Comments
 (0)