mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
619 restructure local storage (#628)
* To MMKV migration working * POC migrated font size settings * Moved settings to mmkv * Fix typos * Migrated contexts slice * Migrated app slice * POC instance emoji update * Migrated drafts * Migrated simple instance properties * All migrated! * Re-structure files * Tolerant of undefined settings * Can properly logging in and out including empty state
This commit is contained in:
58
src/utils/helpers/featureCheck.ts
Normal file
58
src/utils/helpers/featureCheck.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import { getAccountStorage } from '@utils/storage/actions'
|
||||
|
||||
const features = [
|
||||
{
|
||||
feature: 'account_follow_notify',
|
||||
version: 3.3
|
||||
},
|
||||
{
|
||||
feature: 'notification_type_status',
|
||||
version: 3.3
|
||||
},
|
||||
{
|
||||
feature: 'account_return_suspended',
|
||||
version: 3.3
|
||||
},
|
||||
{
|
||||
feature: 'edit_post',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'deprecate_auth_follow',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'notification_type_update',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'notification_type_admin_signup',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'notification_types_positive_filter',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'trends_new_path',
|
||||
version: 3.5
|
||||
},
|
||||
{
|
||||
feature: 'follow_tags',
|
||||
version: 4.0
|
||||
},
|
||||
{
|
||||
feature: 'notification_type_admin_report',
|
||||
version: 4.0
|
||||
},
|
||||
{
|
||||
feature: 'filter_server_side',
|
||||
version: 4.0
|
||||
}
|
||||
]
|
||||
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user