2022-02-12 14:51:01 +01:00
|
|
|
import { SettingsV0 } from './v0'
|
|
|
|
import { SettingsV1 } from './v1'
|
2022-05-13 00:04:15 +02:00
|
|
|
import { SettingsV2 } from './v2'
|
2022-11-29 23:44:11 +01:00
|
|
|
import { SettingsV3 } from './v3'
|
2022-02-12 14:51:01 +01:00
|
|
|
|
|
|
|
const settingsMigration = {
|
|
|
|
1: (state: SettingsV0): SettingsV1 => {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
darkTheme: 'lighter'
|
|
|
|
}
|
2022-05-13 00:04:15 +02:00
|
|
|
},
|
|
|
|
2: (state: SettingsV1): SettingsV2 => {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
darkTheme: 'lighter',
|
|
|
|
staticEmoji: false
|
|
|
|
}
|
2022-11-29 23:44:11 +01:00
|
|
|
},
|
|
|
|
3: (state: SettingsV2): SettingsV3 => {
|
|
|
|
const { analytics, ...rest } = state
|
|
|
|
return rest
|
2022-02-12 14:51:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default settingsMigration
|