Skip to content

Commit

Permalink
Fix - issue with chapter import when scene data has notes; QoL - add …
Browse files Browse the repository at this point in the history
…loading beholder when importing scenes so it's known something is happening
  • Loading branch information
Azmoria committed Feb 15, 2025
1 parent 400b058 commit 2b61d18
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ScenesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2832,6 +2832,7 @@ function build_source_book_chapter_import_section(sceneSet) {
const parentId = $(`#sources-import-main-container`).attr("data-parent-id");

import_chapter.off('click.importChap').on('click.importChap', function(){
build_import_loading_indicator(`Importing Chapter`);
for(let i in sceneData){
sceneData[i] = {
...default_scene_data(),
Expand Down Expand Up @@ -2861,7 +2862,7 @@ function build_source_book_chapter_import_section(sceneSet) {
for(let id in sceneData[i].notes){
window.JOURNAL.notes[id] = sceneData[i].notes[id];
}
delete importData.notes;
delete sceneData[i].notes;

}
}
Expand All @@ -2872,8 +2873,10 @@ function build_source_book_chapter_import_section(sceneSet) {
$(`.scene-item[data-scene-id='${sceneData[0].id}'] .dm_scenes_button`).click();
$("#sources-import-main-container").remove();
expand_all_folders_up_to_id(sceneData[0].id);
$(`body>.import-loading-indicator`).remove();
})
.catch(error => {
$(`body>.import-loading-indicator`).remove();
showError(error, "Failed to import scene", importData);
});
})
Expand Down Expand Up @@ -3109,7 +3112,7 @@ function build_tutorial_import_list_item(scene, logo, allowMagnific = true) {
listItem.find(".import-button").click(function(e) {
e.stopPropagation();
e.preventDefault();

build_import_loading_indicator(`Importing Scene`);
const folderPath = decode_full_path($(`#sources-import-main-container`).attr("data-folder-path")).replace(RootFolder.Scenes.path, "");
const parentId = $(`#sources-import-main-container`).attr("data-parent-id");

Expand Down Expand Up @@ -3144,8 +3147,10 @@ function build_tutorial_import_list_item(scene, logo, allowMagnific = true) {
$(`.scene-item[data-scene-id='${importData.id}'] .dm_scenes_button`).click();
$("#sources-import-main-container").remove();
expand_all_folders_up_to_id(importData.id);
$(`body>.import-loading-indicator`).remove();
})
.catch(error => {
$(`body>.import-loading-indicator`).remove();
showError(error, "Failed to import scene", importData);
});
});
Expand Down

0 comments on commit 2b61d18

Please sign in to comment.