Skip to content

Commit

Permalink
Fix ignoring duplicates (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
neeilya authored and euvl committed Oct 20, 2019
1 parent 8ec6335 commit 0fcb1b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
12 changes: 7 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions dist/ssr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ const Component = {
? event.speed
: this.speed
const ignoreDuplicates = typeof event.ignoreDuplicates === 'boolean'
? event.ignoreDuplicates
: this.ignoreDuplicates
let { title, text, type, data } = event
const item = {
Expand All @@ -253,7 +257,7 @@ const Component = {
let indexToDestroy = -1
const isDuplicate = Boolean(this.active.find(item => item.title === event.title && item.text === event.text));
const canAdd = this.ignoreDuplicates ? !isDuplicate : true;
const canAdd = ignoreDuplicates ? !isDuplicate : true;
if (!canAdd) return;
Expand Down

0 comments on commit 0fcb1b2

Please sign in to comment.