Skip to content

Commit

Permalink
Embed default UNKNOWN version
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Jul 25, 2023
1 parent 2df194b commit 7a87f51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/components/Version/version.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import React, { useEffect, useState } from 'react';
import React from 'react';
import Typography from '@mui/material/Typography';

const loadVersion = async () => {
try {
return await import('../../version.json');
} catch (e) {
return { version: 'unknown' };
}
};
import version from '../../version.json';

function Version() {
const [version, setVersion] = useState('');

useEffect(() => {
loadVersion().then((v) => {
setVersion(v.version);
});
}, []);

return (
<Typography variant="caption" align="right" color="inherit" style={{ flexGrow: 1 }}>
Version: {version}
Version: {version.version}
</Typography>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "UNKNOWN"
}

0 comments on commit 7a87f51

Please sign in to comment.