fix(editor): Prevent canvas undo/redo when NDV is open (#8118)

## Summary
Preventing canvas undo/redo while NDV or any modal is open. We already
had a NDV open check in place but looks like it was broken by unreactive
ref inside `useHistoryHelper` composable.
This PR fixes this by using store getter directly inside the helper
method and adds modal open check.

## Related tickets and issues
Fixes ADO-657

## Review / Merge checklist
- [ ] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [ ] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again.
   > A feature is not complete without tests.
This commit is contained in:
Milorad FIlipović
2023-12-22 08:42:53 +01:00
committed by GitHub
parent 711fa2b925
commit 39e45d8b92
6 changed files with 84 additions and 20 deletions

View File

@@ -139,6 +139,9 @@ export const useNDVStore = defineStore(STORES.NDV, {
return null;
},
isNDVOpen(): boolean {
return this.activeNodeName !== null;
},
},
actions: {
setActiveNodeName(nodeName: string | null): void {