Ensure other modals are closed when deleting maps or tokens

This commit is contained in:
Mitchell McCaffrey 2021-01-25 09:00:19 +11:00
parent 99502bc878
commit fcb87104cd
2 changed files with 7 additions and 0 deletions

View File

@ -332,6 +332,10 @@ function SelectMapModal({
selectedMapIds.length > 0 &&
!selectedMaps.some((map) => map.type === "default")
) {
// Ensure all other modals are closed
setIsGroupModalOpen(false);
setIsEditModalOpen(false);
setIsMapsResetModalOpen(false);
setIsMapsRemoveModalOpen(true);
}
}

View File

@ -191,6 +191,9 @@ function SelectTokensModal({ isOpen, onRequestClose }) {
selectedTokenIds.length > 0 &&
!selectedTokens.some((token) => token.type === "default")
) {
// Ensure all other modals are closed
setIsEditModalOpen(false);
setIsGroupModalOpen(false);
setIsTokensRemoveModalOpen(true);
}
}