Return early from function if there is no message to notify
This commit is contained in:
parent
0c0e141259
commit
de3cf6c2cf
|
@ -190,18 +190,19 @@ Notifier.fatalCallbacks = [];
|
|||
|
||||
Notifier.pullMessageFromUrl = ($location) => {
|
||||
const queryString = $location.search();
|
||||
if (queryString.notif_msg) {
|
||||
const message = queryString.notif_msg;
|
||||
const config = queryString.notif_loc ? { location: queryString.notif_loc } : {};
|
||||
const level = queryString.notif_lvl || 'info';
|
||||
|
||||
$location.search('notif_msg', null);
|
||||
$location.search('notif_loc', null);
|
||||
$location.search('notif_lvl', null);
|
||||
|
||||
const notifier = new Notifier(config);
|
||||
notifier[level](message);
|
||||
if (!queryString.notif_msg) {
|
||||
return;
|
||||
}
|
||||
const message = queryString.notif_msg;
|
||||
const config = queryString.notif_loc ? { location: queryString.notif_loc } : {};
|
||||
const level = queryString.notif_lvl || 'info';
|
||||
|
||||
$location.search('notif_msg', null);
|
||||
$location.search('notif_loc', null);
|
||||
$location.search('notif_lvl', null);
|
||||
|
||||
const notifier = new Notifier(config);
|
||||
notifier[level](message);
|
||||
};
|
||||
|
||||
// simply a pointer to the global notif list
|
||||
|
|
Loading…
Reference in a new issue