Merge branch 'migrate-accounts-to-idb' into sw-notification-action

This commit is contained in:
tamaina
2021-07-19 15:53:49 +09:00
33 changed files with 500 additions and 152 deletions

View File

@@ -4,46 +4,14 @@
import '@client/style.scss';
//#region account indexedDB migration
import { set } from '@client/scripts/idb-proxy';
// TODO: そのうち消す
if (localStorage.getItem('vuex') != null) {
const vuex = JSON.parse(localStorage.getItem('vuex'));
localStorage.setItem('account', JSON.stringify({
...vuex.i,
token: localStorage.getItem('i')
}));
set('accounts', JSON.parse(JSON.stringify(vuex.device.accounts)));
localStorage.setItem('miux:themes', JSON.stringify(vuex.device.themes));
if (vuex.device.userData) {
for (const [k, v] of Object.entries(vuex.device.userData)) {
localStorage.setItem('pizzax::base::' + k, JSON.stringify({
widgets: v.widgets
}));
if (v.deck) {
localStorage.setItem('pizzax::deck::' + k, JSON.stringify({
columns: v.deck.columns,
layout: v.deck.layout,
}));
}
}
}
localStorage.setItem('vuex-old', JSON.stringify(vuex));
localStorage.removeItem('vuex');
localStorage.removeItem('i');
localStorage.removeItem('locale');
location.reload();
}
if (localStorage.getItem('accounts') != null) {
set('accounts', JSON.parse(localStorage.getItem('accounts')));
localStorage.removeItem('accounts');
}
//#endregion
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';