1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Refine account switching

Part of #663
This commit is contained in:
xmflsct
2023-01-16 22:11:41 +01:00
parent 74e794a215
commit 196f51bfca
6 changed files with 89 additions and 142 deletions

View File

@ -51,8 +51,6 @@ const features = [
}
]
export const featureCheck = (feature: string): boolean => {
const version = getAccountStorage.string('version')
return !!features.filter(f => f.feature === feature).filter(f => parseFloat(version) >= f.version)
?.length
}
export const featureCheck = (feature: string, v?: string): boolean =>
(features.find(f => f.feature === feature)?.version || 999) <=
parseFloat(v || getAccountStorage.string('version'))