Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaving a closed form triggers warning #2503

Closed
Chartman123 opened this issue Jan 17, 2025 · 3 comments · Fixed by #2504
Closed

Leaving a closed form triggers warning #2503

Chartman123 opened this issue Jan 17, 2025 · 3 comments · Fixed by #2504
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working javascript Javascript related ticket
Milestone

Comments

@Chartman123
Copy link
Collaborator

Chartman123 commented Jan 17, 2025

Please use the 👍 reaction to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug
When you leave a form that was closed manually and that still has some data in the local storage, you will see the message that asks if you really want to leave the current form. There's no way to reset the form and clear the local storage for the user directly.

To Reproduce
Steps to reproduce the behavior:

  1. Go to form and fill in something in view mode
  2. Manually close it in the settings
  3. Navigate to another form
  4. See warning

Expected behavior
No warning

Nextcloud (please complete the following information):

  • Nextcloud-Version: [e.g. 19.0.0] 31.0.0-beta4
  • Forms-Version: [e.g. 2.0.0-beta4] 5.0.0-alpha.0

Browser log

TypeError: this.form.questions is undefined

triggered in validQuestions in Submit.vue:313
@Chartman123 Chartman123 added 1. to develop Accepted and waiting to be taken care of bug Something isn't working high High priority javascript Javascript related ticket labels Jan 17, 2025
@Chartman123 Chartman123 added this to the 5.0 milestone Jan 17, 2025
@Chartman123 Chartman123 removed the high High priority label Jan 17, 2025
@Chartman123
Copy link
Collaborator Author

I think we should simply query the form state when we evaluate if the message should be shown and only show it, when the form is active.

@susnux @hamza @Koc what do you think?

@susnux
Copy link
Collaborator

susnux commented Jan 17, 2025

I think we should simply query the form state when we evaluate if the message should be shown and only show it, when the form is active.

Yes 💯 . I would maybe event clear the state in that case.

@Chartman123
Copy link
Collaborator Author

Yes, I also thought about that... But perhaps we should move the cleaning to some other process during the app initialisation in the browser and cleanup all forms in local storage that are either no longer available or in a not active state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working javascript Javascript related ticket
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants