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

Added instance configuration support

This commit is contained in:
Zhiyuan Zheng
2021-11-15 22:34:43 +01:00
parent 98dd7b2b46
commit 7ac789c18c
16 changed files with 302 additions and 101 deletions

View File

@ -1,5 +1,6 @@
import { InstanceV3 } from './v3'
import { InstanceV4 } from './v4'
import { InstanceV5 } from './v5'
const instancesMigration = {
4: (state: InstanceV3) => {
@ -27,7 +28,6 @@ const instancesMigration = {
}
},
5: (state: InstanceV4) => {
// Migration is run on each start, don't know why
// @ts-ignore
if (state.instances.length && !state.instances[0].notifications_filter) {
return {
@ -47,6 +47,11 @@ const instancesMigration = {
} else {
return state
}
},
6: (state: InstanceV5) => {
return state.instances.map(instance => {
return { ...instance, configuration: undefined }
})
}
}