mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-09 09:52:34 +01:00
avoid total UI failing on project load
This commit is contained in:
parent
c6b17c60e5
commit
ccea7762e8
1 changed files with 9 additions and 5 deletions
|
|
@ -29,12 +29,16 @@ export function activate({services, bus}) {
|
|||
}
|
||||
|
||||
function load() {
|
||||
let data = services.storage.get(services.project.projectStorageKey());
|
||||
if (data) {
|
||||
let history = JSON.parse(data).history;
|
||||
if (history) {
|
||||
services.craft.reset(history);
|
||||
try {
|
||||
let data = services.storage.get(services.project.projectStorageKey());
|
||||
if (data) {
|
||||
let history = JSON.parse(data).history;
|
||||
if (history) {
|
||||
services.craft.reset(history);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue