chandler
chandler copied to clipboard
The toaster component no longer works and needs to be replaced
We used to have a toaster that displayed success messages. It broke somehow and now it doesn't work anymore.
It's located in Toaster.vue
.
There are two ways of calling it:
- either by putting a message in the local storage, like
localStorage.success = 'The contact has been edited';
and then it appears on next page load - or call the toaster directly with
this.flash('The call reason type has been created', 'success');
.
I have no idea why it doesn't work anymore. We either need to replace it, or make the current one work.
Hey there, was poking around the codebase and I found the solution to this. It was somehow a dependecy mismatch. The <Toaster \>
component uses mitt, and the methods.js
mixin is using tiny-emitter. I can fix it depending on which do you want to keep as a dependency.
I could also add a unit test to catch something like this in the future, but that also would require adding jest to the project. Let me know how you'd want me to proceed and I can make a PR..
Thanks for your comment @javier123454321 I have no idea which one I want to keep as a dependency 😄
Both mitt and tiny-emitter were added because I saw a tutorial that shows a tutorial that probably indicated those two, but I don't really know this stuff so if you know better, please suggest something in the PR.
Also, it'd be great to add Jest, so if you are up for it, please go!