Skip to content

Commit a21d23e

Browse files
authored
Merge pull request vttred#442 from vttred/fix/compendium-folders-drag-drop
fix: compendium folders drag-and-drop
2 parents 015f706 + 1278e9b commit a21d23e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/module/actor/actor-sheet.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,21 @@ export default class OseActorSheet extends ActorSheet {
283283
const folder = await fromUuid(data.uuid);
284284
if (!folder || folder.type !== "Item") return;
285285

286-
let itemArray = folder.contents;
286+
let itemArray = folder.contents || [];
287287

288288
folder.getSubfolders(true).forEach((subfolder) => {
289289
itemArray.push(...subfolder.contents);
290290
});
291291

292+
// Compendium items
293+
if (itemArray.length > 0 && itemArray[0]?.uuid?.includes("Compendium")) {
294+
const items = [];
295+
itemArray.forEach(async (item) => {
296+
items.push(await fromUuid(item.uuid));
297+
});
298+
itemArray = items;
299+
}
300+
292301
this._onDropItemCreate(itemArray);
293302
}
294303

0 commit comments

Comments
 (0)