adapt-security / adapt-authoring-ui

Frontend user interface of the Adapt authoring tool
1 stars 2 forks source link

Console errors on snackbar close if no data present #281

Closed joe-allen-89 closed 2 months ago

joe-allen-89 commented 5 months ago

What happened?

Snackbar checks for data.callback on close, this is leading to regular console errors on screen change.

Expected behaviour

No console error, check if data is present before checking for callbacks

Steps to reproduce

Navigate between screens in project management

Authoring tool version

rc4

Framework version

No response

What browsers are you seeing the problem on?

No response

Relevant log output

Uncaught TypeError: data is undefined
    close http://localhost:5678/modules/notify/plugins/snackbar/index.js:43
    setTimeout handler*close http://localhost:5678/modules/notify/plugins/snackbar/index.js:40
    close http://localhost:5678/modules/notify/plugins/snackbar/index.js:50
    remove http://localhost:5678/modules/pluginManagement/views/pluginManagementView.js:97
    Backbone 2
    trigger http://localhost:5678/core/origin.js:101
    callTap http://localhost:5678/core/origin.js:158
    callTaps http://localhost:5678/core/origin.js:161
    trigger http://localhost:5678/core/origin.js:97
    removeViews http://localhost:5678/core/origin.js:116
    handleRoute http://localhost:5678/core/router.js:124
    Backbone 2
    any Underscore
    Backbone 3
    navigateTo http://localhost:5678/core/router.js:102
    managePluginType http://localhost:5678/modules/pluginManagement/views/pluginManagementSidebarView.js:41
    onManageComponentsClicked http://localhost:5678/modules/pluginManagement/views/pluginManagementSidebarView.js:29
    Underscore 3
    jQuery 7
    Backbone 5
    <anonymous> http://localhost:5678/modules/pluginManagement/index.js:33
    Backbone 2
    trigger http://localhost:5678/core/origin.js:101
    callTap http://localhost:5678/core/origin.js:158
    callTaps http://localhost:5678/core/origin.js:161
    trigger http://localhost:5678/core/origin.js:97
    handleRoute http://localhost:5678/core/router.js:130
    Backbone 2
    any Underscore
    Backbone 3
    navigateTo http://localhost:5678/core/router.js:102
    onMenuItemClicked http://localhost:5678/modules/globalMenu/views/globalMenuItemView.js:95
    Underscore 3
    dispatch jQuery
index.js:43:10