Switch to event type
This commit is contained in:
14
web/src/app/events.js
Normal file
14
web/src/app/events.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// Event types for ntfy messages
|
||||
// These correspond to the server event types in server/types.go
|
||||
|
||||
export const EVENT_OPEN = "open";
|
||||
export const EVENT_KEEPALIVE = "keepalive";
|
||||
export const EVENT_MESSAGE = "message";
|
||||
export const EVENT_MESSAGE_DELETE = "message_delete";
|
||||
export const EVENT_MESSAGE_READ = "message_read";
|
||||
export const EVENT_POLL_REQUEST = "poll_request";
|
||||
|
||||
// Check if an event is a notification event (message, delete, or read)
|
||||
export const isNotificationEvent = (event) =>
|
||||
event === EVENT_MESSAGE || event === EVENT_MESSAGE_DELETE || event === EVENT_MESSAGE_READ;
|
||||
|
||||
Reference in New Issue
Block a user