Notification improvements
- Remove on read, on focus, and on exit. - Show multi-message notifications like '5 new messages'.
This commit is contained in:
parent
f693c00778
commit
3bf8a8966a
7 changed files with 104 additions and 23 deletions
|
@ -17,6 +17,7 @@ export type IncomingMessage = Readonly<
|
|||
body?: string;
|
||||
decrypted_at?: number;
|
||||
errors?: Array<any>;
|
||||
expireTimer?: number;
|
||||
flags?: number;
|
||||
source?: string;
|
||||
sourceDevice?: number;
|
||||
|
@ -89,3 +90,15 @@ type MessageSchemaVersion6 = Partial<
|
|||
contact: Array<Contact>;
|
||||
}>
|
||||
>;
|
||||
|
||||
export const isUserMessage = (message: Message): message is UserMessage =>
|
||||
message.type === 'incoming' || message.type === 'outgoing';
|
||||
|
||||
export const hasExpiration = (message: Message): boolean => {
|
||||
if (!isUserMessage(message)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { expireTimer } = message;
|
||||
return typeof expireTimer === 'number' && expireTimer > 0;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue