fix: TypeError cannot read properties of undefined (reading '$store') (#9777)

This issue is an extremely narrow edge case that does not affect the app functionality. It occurs here

1. `executeRecurringNotification` is the method that sets a timeout of 30 seconds and pings as required
2. This method is triggered when one of the following events happen `click`, `touchstart`, `keypress`, `keydown`
3. The class in question is initalized before the Vue app is mounted in `application.js`, the vue app is mounted on `window.onload` event
4. In a case where the Vue app is not created (i.e. `window.onload` event is not fired) within 30 seconds of a user input, this error occurs.
This commit is contained in:
Sivin Varghese
2024-07-15 18:50:43 +05:30
committed by GitHub
parent 5cfac31f93
commit ebf3b46f0d

View File

@@ -52,6 +52,10 @@ class DashboardAudioNotificationHelper {
};
executeRecurringNotification = () => {
if (!window.WOOT || !window.WOOT.$store) {
this.clearSetTimeout();
return;
}
const mineConversation = window.WOOT.$store.getters.getMineChats({
assigneeType: 'me',
status: 'open',