Skip to content

Commit

Permalink
馃洜 Fix missing notifications (#2614)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomaricMourgues authored and Labels Bot committed Nov 17, 2022
1 parent 34395b1 commit 9d3c5f1
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@ export class NotificationPreferencesService implements TwakeServiceProvider, Ini
const notificationPreferences = (user?.preferences?.notifications || []).find(n => {
return n.company_id === pk.company_id && n.workspace_id === pk.workspace_id;
});
return notificationPreferences;
return (
notificationPreferences || {
company_id: pk.company_id,
workspace_id: pk.workspace_id,
preferences: {
highlight_words: [],
night_break: {
enable: false,
from: 0,
to: 0,
},
private_message_content: false,
mobile_notifications: "always",
email_notifications_delay: 15,
deactivate_notifications_until: 0,
notification_sound: "default",
},
}
);
}

/** We can define preferences for specifically a workspace or for all a company or all Twake
Expand Down

0 comments on commit 9d3c5f1

Please sign in to comment.