Skip to content

Commit

Permalink
PREAPPS-3593: Code Improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anukriti Jagatramka authored and Anukriti Jagatramka committed Oct 24, 2019
1 parent a31ae9c commit 73d5d98
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/schema/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export class ZimbraNotifications {

// Find the actual folder of the shared folder
private findSharedItemId = (item: any) => {
let sharedFolderId: any;
const cachedData = get(this.cache, 'data.data');
const allFolders = Object.keys(cachedData).filter(f =>
f.includes('Folder:')
Expand All @@ -160,11 +159,9 @@ export class ZimbraNotifications {
folder.ownerZimbraId === idSplit[0] &&
folder.sharedItemId === idSplit[1]
) {
sharedFolderId = folder.id;
break;
return folder.id;
}
}
return sharedFolderId;
};

private handleContactNotifications = (notification: Notification) => {
Expand Down Expand Up @@ -324,8 +321,8 @@ export class ZimbraNotifications {
if (items) {
items.forEach((i: any) => {
const item = normalizeFolder(i);
const itemId = get(i, 'id', '').includes(':')
? this.findSharedItemId(i.id)
const itemId = item.id.includes(':')
? this.findSharedItemId(item.id)
: item.id;
this.cache.writeFragment({
id: `Folder:${itemId}`,
Expand Down

0 comments on commit 73d5d98

Please sign in to comment.