Skip to content

Commit

Permalink
Improve standalone version indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Nov 3, 2021
1 parent 8f8bb85 commit e874067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/build/version-loader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = () => {
if (process.env.STANDALONE) {
const now = new Date();
return `export default ${JSON.stringify(`${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`)};`;
const dateString = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
return `export default ${JSON.stringify(`Standalone version (${dateString})`)}`;
}
return `export default null;`;
};
6 changes: 3 additions & 3 deletions src/p4/P4.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Progress from './Progress.svelte';
import Modals from './Modals.svelte';
import {progress, theme} from './stores';
import {isSupported, isSafari, isStandalone} from './environment';
import {isSupported, isSafari} from './environment';
import version from '../build/version-loader!';
import {LONG_NAME, FEEDBACK_GITHUB, FEEDBACK_SCRATCH, SOURCE_CODE} from '../packager/brand';
Expand Down Expand Up @@ -109,8 +109,8 @@
<Section accent="#ff4c4c">
<div>
<h1>{LONG_NAME}</h1>
{#if isStandalone}
<p><i>Standalone version ({version})</i></p>
{#if version}
<p><i>{version}</i></p>
{/if}
<p>{$_('p4.description1')}</p>
<p>
Expand Down

0 comments on commit e874067

Please sign in to comment.