fix: delay version logging & prevent duplicates (#2770)

This commit is contained in:
David Luzar 2021-01-12 17:47:31 +01:00 committed by GitHub
parent 62f1ed74f1
commit adcd28f348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -364,6 +364,8 @@ export const nFormatter = (num: number, digits: number): string => {
};
export const getVersion = () => {
const version = document.querySelector('meta[name="version"]');
return version ? (version as any).content : DEFAULT_VERSION;
return (
document.querySelector<HTMLMetaElement>('meta[name="version"]')?.content ||
DEFAULT_VERSION
);
};