spacemandev-git / fvtt-card-support

Adds programmatic deck support to FoundryVTT
MIT License
10 stars 10 forks source link

Gracefully handle multiple folders named "Decks" #11

Open Norc opened 4 years ago

Norc commented 4 years ago

User Zeel was having issues in one world only. Decks would only exist until a refresh, then the deck would be undefined and using any of their properties would fail.

This was traced down to three different folders with the name "Decks", as shown by this simple query: game.folders.filter(f => f.data.name == "Decks"). Renaming the other folders resolved this issue.

Spaceman was going to explore options to handle htis more gracefully, including possibly naming the folder _Decks and checking that it was in the Jorunal Entry tab and/or storing the folder ID as a global setting.

zeel01 commented 4 years ago

I imagine one could also store a flag on the folder? That would be invisible to the user (unlike the deck name), and shouldn't cause conflicts. One could easily support multiple deck folders that way too I would think, if the user wanted to organize differently.