Handle exception when migrating cache
This commit is contained in:
parent
8a218504c1
commit
0d3e91a617
@ -140,6 +140,15 @@ function readCache(initialState: GlobalState): GlobalState {
|
||||
}
|
||||
|
||||
export function migrateCache(cached: GlobalState, initialState: GlobalState) {
|
||||
try {
|
||||
unsafeMigrateCache(cached, initialState);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
function unsafeMigrateCache(cached: GlobalState, initialState: GlobalState) {
|
||||
// Migrate from legacy setting names
|
||||
if ('shouldAutoDownloadMediaFromContacts' in cached.settings.byKey) {
|
||||
const {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user