Skip to content

Commit

Permalink
BUG Tweak Legacy Toast Container to wait for Injector to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Rainville committed Feb 5, 2021
1 parent dc1c7ce commit a2b043a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions client/src/legacy/ToastsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ jQuery.entwine('ss', ($) => {
((jquery) => {
jquery.extend({
noticeAdd(options) {
// Manually dispatch a redux display event
const { dispatch } = Injector.reducer.store;
dispatch(display(options));
Injector.ready(() => {
// Manually dispatch a redux display event
const { dispatch } = Injector.reducer.store;
dispatch(display(options));
});
}
});
})(jQuery);

0 comments on commit a2b043a

Please sign in to comment.