mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 14:54:12 +00:00
Preview suites migration hotfix
This commit is contained in:
parent
ccf53836a2
commit
5c69810c8d
2 changed files with 29 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ResponsivelyApp",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "A developer-friendly browser for developing responsive web apps",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import Store from 'electron-store';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
import { PreviewSuites } from '../renderer/store/features/device-manager';
|
||||
|
||||
import { defaultDevices, Device } from '../common/deviceList';
|
||||
|
||||
const defaultActiveDevices = ['10008', '10013', '10015'];
|
||||
|
@ -50,15 +52,40 @@ export const migrations = {
|
|||
{
|
||||
id: 'default',
|
||||
name: 'Default',
|
||||
devices: newActiveDevices,
|
||||
devices:
|
||||
newActiveDevices.length > 0
|
||||
? newActiveDevices
|
||||
: defaultActiveDevices,
|
||||
},
|
||||
]);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Migration failed', e);
|
||||
store.set('deviceManager.previewSuites', [
|
||||
{
|
||||
id: 'default',
|
||||
name: 'Default',
|
||||
devices: defaultActiveDevices,
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Migration successful', store.get('deviceManager'));
|
||||
},
|
||||
'1.2.1': (store: Store) => {
|
||||
const suites = store.get('deviceManager.previewSuites') as
|
||||
| PreviewSuites
|
||||
| undefined;
|
||||
if (suites == null || suites.length > 0) {
|
||||
return;
|
||||
}
|
||||
store.set('deviceManager.previewSuites', [
|
||||
{
|
||||
id: 'default',
|
||||
name: 'Default',
|
||||
devices: defaultActiveDevices,
|
||||
},
|
||||
]);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue