diff --git a/package.json b/package.json index 23dac7d661..9d138078fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polkadot-staking-dashboard", - "version": "1.4.3", + "version": "1.4.4", "type": "module", "license": "GPL-3.0-only", "scripts": { diff --git a/src/consts.ts b/src/consts.ts index 8f2d74b0c7..79e7366fb0 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -6,7 +6,6 @@ import { stringToU8a } from '@polkadot/util'; /* * Global Constants */ -export const AppVersion = '1.4.3'; export const DappName = 'Polkadot Staking Dashboard'; export const PolkadotUrl = 'https://polkadot.network/features/staking/'; export const ManualSigners = ['ledger', 'vault']; diff --git a/src/contexts/Migrate/index.tsx b/src/contexts/Migrate/index.tsx index 47285cd2b0..f1c7717b9a 100644 --- a/src/contexts/Migrate/index.tsx +++ b/src/contexts/Migrate/index.tsx @@ -3,10 +3,10 @@ import type { ReactNode } from 'react'; import { createContext, useState } from 'react'; -import { AppVersion } from 'consts'; import { useApi } from 'contexts/Api'; import { useEffectIgnoreInitial } from '@w3ux/hooks'; import { useSyncing } from 'hooks/useSyncing'; +import { version } from '../../../package.json'; export const MigrateContext = createContext(null); @@ -18,7 +18,7 @@ export const MigrateProvider = ({ children }: { children: ReactNode }) => { const localAppVersion = localStorage.getItem('app_version'); // Store whether the migration check has taken place. - const [done, setDone] = useState(localAppVersion === AppVersion); + const [done, setDone] = useState(localAppVersion === version); // Removes local era stakers data and locale data. const removeLocalErasAndLocales = () => { @@ -42,7 +42,7 @@ export const MigrateProvider = ({ children }: { children: ReactNode }) => { useEffectIgnoreInitial(() => { if (isReady && !syncing && !done) { // Carry out migrations if local version is different to current version. - if (localAppVersion !== AppVersion) { + if (localAppVersion !== version) { // Added in 1.4.3 // // Remove local era stakers data and locale data. Paged rewards are now active and local @@ -54,7 +54,7 @@ export const MigrateProvider = ({ children }: { children: ReactNode }) => { // Finally, // // Update local version to current app version. - localStorage.setItem('app_version', AppVersion); + localStorage.setItem('app_version', version); setDone(true); } } diff --git a/src/locale/index.tsx b/src/locale/index.tsx index 2fdfbae5b2..cc24954ffc 100644 --- a/src/locale/index.tsx +++ b/src/locale/index.tsx @@ -4,7 +4,7 @@ import { enGB, zhCN } from 'date-fns/locale'; import i18next from 'i18next'; import { initReactI18next } from 'react-i18next'; -import { AppVersion } from 'consts'; +import { version } from '../../package.json'; import type { AnyJson } from 'types'; import baseEn from './en/base.json'; import helpEn from './en/help.json'; @@ -51,7 +51,7 @@ export const fallbackResources = { // Refresh local storage resources if in development, or if new app version is present. if ( - localStorage.getItem('app_version') !== AppVersion || + localStorage.getItem('app_version') !== version || import.meta.env.MODE === 'development' ) { localStorage.removeItem('lng_resources');