From 8db7655a3771a530134982d838e38bdfa3a5e3aa Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 13 Apr 2016 10:39:19 +0200 Subject: [PATCH] Remove deprecated global notification types --- js/models/global_notification_model.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/js/models/global_notification_model.js b/js/models/global_notification_model.js index 40f9c4f4..eda6db18 100644 --- a/js/models/global_notification_model.js +++ b/js/models/global_notification_model.js @@ -1,7 +1,11 @@ 'use strict'; export default class GlobalNotificationModel { - constructor(message, type = 'info', dismissAfter = 5000) { + constructor(message, type = 'success', dismissAfter = 5000) { + if (type !== 'success' && type !== 'danger') { + throw new Error(`A notification's type either has to be success, or danger. Not: ${type}`); + } + if (message) { this.message = message; } else { @@ -11,12 +15,7 @@ export default class GlobalNotificationModel { }); } - if (type === 'info' || type === 'success' || type === 'warning' || type === 'danger') { - this.type = type; - } else { - throw new Error(`A notification's type either has to be info, success, warning, danger. Not: ${type}`); - } - this.dismissAfter = dismissAfter; + this.type = type; } }