mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
Close open prosemirror documents during reset
This commit is contained in:
parent
e10dc83cd9
commit
25f87f1baa
1 changed files with 8 additions and 2 deletions
|
|
@ -141,10 +141,16 @@ const registerNonConfigSettings = () => {
|
||||||
function resetActors(actors) {
|
function resetActors(actors) {
|
||||||
actors ??= [
|
actors ??= [
|
||||||
game.actors.contents,
|
game.actors.contents,
|
||||||
game.scenes.contents.flatMap((s) => s.tokens.contents).flatMap((t) => t.actor ?? []),
|
game.scenes.contents.flatMap(s => s.tokens.contents).flatMap(t => t.actor ?? [])
|
||||||
].flat();
|
].flat();
|
||||||
actors = new Set(actors);
|
actors = new Set(actors);
|
||||||
for (const actor of actors) {
|
for (const actor of actors) {
|
||||||
|
for (const app of Object.values(actor.apps)) {
|
||||||
|
for (const element of app.element?.querySelectorAll('prose-mirror.active')) {
|
||||||
|
element.open = false; // This triggers a save
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
actor.reset();
|
actor.reset();
|
||||||
actor.render();
|
actor.render();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue