-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from wireapp/kj/wir-18-reloading-wire-conversa…
…tion-details-in-a-meeting-where-it-mobile-fix fix: fixed notfication error, added recreating of conversation in spe…
- Loading branch information
Showing
2 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
/* global Office, console */ | ||
|
||
import { isMobileDevice } from "./mailbox"; | ||
|
||
export function showNotification(key, message, type, icon = null, persistent = null) { | ||
const notificationMessage = { | ||
type, | ||
icon, | ||
message, | ||
persistent, | ||
}; | ||
if(!isMobileDevice()){ | ||
const notificationMessage = { | ||
type, | ||
icon, | ||
message, | ||
persistent, | ||
}; | ||
|
||
Office.context.mailbox.item.notificationMessages.addAsync(key, notificationMessage, (result) => { | ||
if (result.status === Office.AsyncResultStatus.Succeeded) { | ||
console.log(`Notification with key "${key}" added successfully.`); | ||
} else { | ||
console.error("Failed to add notification message:", result.error); | ||
} | ||
}); | ||
Office.context.mailbox.item.notificationMessages.addAsync(key, notificationMessage, (result) => { | ||
if (result.status === Office.AsyncResultStatus.Succeeded) { | ||
console.log(`Notification with key "${key}" added successfully.`); | ||
} else { | ||
console.error("Failed to add notification message:", result.error); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
export function removeNotification(key) { | ||
Office.context.mailbox.item.notificationMessages.removeAsync(key, (result) => { | ||
if (result.status === Office.AsyncResultStatus.Succeeded) { | ||
console.log(`Notification with key "${key}" removed successfully.`); | ||
} else { | ||
console.error("Failed to remove notification:", result.error); | ||
} | ||
}); | ||
if(!isMobileDevice()){ | ||
Office.context.mailbox.item.notificationMessages.removeAsync(key, (result) => { | ||
if (result.status === Office.AsyncResultStatus.Succeeded) { | ||
console.log(`Notification with key "${key}" removed successfully.`); | ||
} else { | ||
console.error("Failed to remove notification:", result.error); | ||
} | ||
}); | ||
} | ||
} |