Skip to content

Commit

Permalink
Merge pull request #1115 from antonstjernquist/fix_get-app-id-improve…
Browse files Browse the repository at this point in the history
…-error

fix(notifications): improve missing app error
  • Loading branch information
itschip authored Jan 13, 2024
2 parents a831984 + ca0139e commit d315c4b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export const useNotificationListener = () => {
const createNotification = (data: CreateNotificationDTO) => {
const app = getApp(data.appId);

if (!app) {
console.error(`Failed to create notification. The app with id ${data.appId} was not found!`);
console.error(`Make sure you pass the correct appId when creating a notification.`);
return;
}

enqueueNotification({
appId: app.id,
content: data.content,
Expand Down

0 comments on commit d315c4b

Please sign in to comment.