kingkont 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/renderer/templates.js +19 -2
package/package.json
CHANGED
package/renderer/templates.js
CHANGED
|
@@ -487,11 +487,28 @@ async function openProjectTemplate(templateId, suggestedName) {
|
|
|
487
487
|
|
|
488
488
|
// 6. Открываем созданный проект.
|
|
489
489
|
TPL_PROGRESS.update(totalFiles, totalFiles, 'Открытие проекта…');
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
// Чистим stale lastBoard:<name> — иначе если у юзера раньше был
|
|
491
|
+
// проект с таким же именем, openFilm попытается auto-select board'а
|
|
492
|
+
// которого нет в свежей структуре, что иногда блокирует загрузку.
|
|
493
|
+
try { localStorage.removeItem(`lastBoard:${projectName}`); } catch {}
|
|
494
|
+
// Закрываем модалку ДО openFilm — иначе её прогресс-бар остаётся
|
|
495
|
+
// на экране пока юзер кликает в sidebar и блокирует UX.
|
|
492
496
|
TPL_PROGRESS.hide();
|
|
493
497
|
document.getElementById('templatesModal').classList.add('hidden');
|
|
494
498
|
tplStatus('');
|
|
499
|
+
|
|
500
|
+
await openFilm(filmHandle);
|
|
501
|
+
|
|
502
|
+
// Auto-select первого board'а в новом проекте — без этого юзер видит
|
|
503
|
+
// пустой холст и может думать что данные не загрузились.
|
|
504
|
+
if (boards.length) {
|
|
505
|
+
const first = boards[0];
|
|
506
|
+
const list = first.kind === 'character' ? await listCharacters(filmHandle)
|
|
507
|
+
: first.kind === 'location' ? await listLocations(filmHandle)
|
|
508
|
+
: await listEpisodes(filmHandle);
|
|
509
|
+
const found = list.find(x => x.name === first.name);
|
|
510
|
+
if (found) await selectBoard({ kind: first.kind, ...found });
|
|
511
|
+
}
|
|
495
512
|
} catch (e) {
|
|
496
513
|
TPL_PROGRESS.hide();
|
|
497
514
|
tplStatus('Ошибка открытия проекта: ' + e.message, true);
|