e0ipso/message-center

Add doesn't work after reset

Opened this issue · 2 comments

The following, self-explanatory code results in an empty mcMessages array (no message displayed).

messageCenterService.reset();
messageCenterService.add('danger', 'This is dangerous');

A workaround for this is to use:

messageCenterService.markShown();
messageCenterService.removeShown();
messageCenterService.add('danger', 'This is dangerous');

It looks like reset is broken.

With this change reset started to work better for me

reset: function () {
  this.mcMessages.splice(0, this.mcMessages.length);
},

@kikonen-fiksu or @jozsi PR please?