Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.

Commit fba435f

Browse files
committed
fix parsing
1 parent d259638 commit fba435f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/webapp/portal/notifications/services.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ define(['angular', 'jquery'], function(angular, $) {
2020

2121
var getDismissedNotificationIds = function() {
2222
dismissedPromise = dismissedPromise || keyValueService.getValue('notification:dismiss').then(function(data){
23-
if(data && !data.value) { //empty state is {value : ""}
23+
if(data && typeof data.value === 'string') { //data and has a value string
24+
if(data.value) { //value string contains things
25+
return JSON.parse(data.value);
26+
} else { //empty state
27+
return [];
28+
}
29+
} else if (data) { //data exists, but data.value doesn't, so its just json
2430
return data;
25-
} else {
31+
} else { // null returned, just empty state it
2632
return [];
2733
}
2834
});

0 commit comments

Comments
 (0)