fix restore tabs on restore workspace from export

This commit is contained in:
Stewart Allen 2020-11-30 09:48:11 -05:00
commit 79d88f2200

View file

@ -1680,15 +1680,6 @@
return; return;
} }
function doit() { function doit() {
if (isSettings) {
settings = CONF.normalize(data.settings);
SDB.setItem('ws-settings', JSON.stringify(settings));
if (LOCAL) console.log('settings',Object.clone(settings));
restoreSettings();
restoreWorkspace(() => {
UI.sync();
}, true);
}
if (isDevice) { if (isDevice) {
if (settings.devices[data.device]) { if (settings.devices[data.device]) {
UC.confirm(`Replace device ${data.device}?`).then(yes => { UC.confirm(`Replace device ${data.device}?`).then(yes => {
@ -1702,14 +1693,23 @@
API.show.devices(); API.show.devices();
} }
} }
if (isWork) { if (isSettings) {
API.platform.clear(); settings = CONF.normalize(data.settings);
KIRI.codec.decode(data.work).forEach(widget => { SDB.setItem('ws-settings', JSON.stringify(settings));
platform.add(widget, 0, true); if (LOCAL) console.log('settings',Object.clone(settings));
}); restoreSettings();
if (data.view) { if (isWork) {
SPACE.view.load(data.view); API.platform.clear();
KIRI.codec.decode(data.work).forEach(widget => {
platform.add(widget, 0, true);
});
if (data.view) {
SPACE.view.load(data.view);
}
} }
restoreWorkspace(() => {
UI.sync();
}, true);
} }
} }
if (ask) { if (ask) {
@ -1864,7 +1864,6 @@
updateFields(); updateFields();
platform.update_size(); platform.update_size();
// platform.update_stock();
let fz = SPACE.scene.freeze(true); let fz = SPACE.scene.freeze(true);
SPACE.view.reset(); SPACE.view.reset();