kanselarij-vlaanderen / frontend-kaleidos

The frontend application of Kaleidos.
2 stars 4 forks source link

fix did-update from trying to get defaults before mailSettings are loaded #2205

Closed ValenberghsSven closed 1 month ago

ValenberghsSven commented 2 months ago

No ticket, trying to fix a bug in the notificationPanel of submissions where it was possible that the did-update was called before the mailSettings were fully loaded, resulting in lists with undefined entries which caused the save of the submission model to throw errors.

By making the did-update check for the mailSettings and running the restartable task again if not, we can ensure we never try to get the defaults before the mailSettings are fully loaded

Perhaps the getters (now using this.emailSettings?.) should not have that optional. If we attempt to call the getters at that stage we should stop instead of setting [undefined]