diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults.tsx index 953ab00a5..5dc8508f2 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults.tsx @@ -15,6 +15,8 @@ import { SharedVaultServiceEvent, VaultUserServiceEvent, RoleName, + ProtocolVersion, + compareVersions, } from '@standardnotes/snjs' import VaultItem from './Vaults/VaultItem' import Button from '@/Components/Button/Button' @@ -24,7 +26,7 @@ import PreferencesPane from '../../PreferencesComponents/PreferencesPane' import { ToastType, addToast } from '@standardnotes/toast' import NoProSubscription from '../Account/NoProSubscription' -const Vaults = () => { +const Vaults = observer(() => { const application = useApplication() const hasAccount = application.hasAccount() @@ -187,7 +189,7 @@ const Vaults = () => { {canCreateMoreVaults ? (
) : (
@@ -244,6 +246,32 @@ const Vaults = () => { )} ) +}) + +const VaultsWrapper = () => { + const application = useApplication() + const hasAccount = application.hasAccount() + const accountProtocolVersion = application.getUserVersion() + const isAccountProtocolNotSupported = + accountProtocolVersion && compareVersions(accountProtocolVersion, ProtocolVersion.V004) < 0 + + if (hasAccount && isAccountProtocolNotSupported) { + return ( + + + Account update required + + In order to use Vaults, you must update your account to use the latest data encryption version. + + + + + ) + } + + return } -export default observer(Vaults) +export default observer(VaultsWrapper)