Persist alert kinds again
This commit is contained in:
parent
501ce8067d
commit
806a7c2609
1 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,11 @@
|
||||||
import {prop, call, on, throttle, fromPairs, batch} from "@welshman/lib"
|
import {prop, call, on, throttle, fromPairs, batch} from "@welshman/lib"
|
||||||
import {throttled, freshness} from "@welshman/store"
|
import {throttled, freshness} from "@welshman/store"
|
||||||
import {
|
import {
|
||||||
|
ALERT_ANDROID,
|
||||||
|
ALERT_EMAIL,
|
||||||
|
ALERT_IOS,
|
||||||
|
ALERT_STATUS,
|
||||||
|
ALERT_WEB,
|
||||||
APP_DATA,
|
APP_DATA,
|
||||||
BLOSSOM_SERVERS,
|
BLOSSOM_SERVERS,
|
||||||
DIRECT_MESSAGE_FILE,
|
DIRECT_MESSAGE_FILE,
|
||||||
|
|
@ -69,6 +74,7 @@ const syncEvents = async () => {
|
||||||
APP_DATA,
|
APP_DATA,
|
||||||
ROOMS,
|
ROOMS,
|
||||||
]
|
]
|
||||||
|
const alertKinds = [ALERT_STATUS, ALERT_EMAIL, ALERT_WEB, ALERT_IOS, ALERT_ANDROID]
|
||||||
const spaceKinds = [RELAY_ADD_MEMBER, RELAY_REMOVE_MEMBER, RELAY_MEMBERS, RELAY_JOIN, RELAY_LEAVE]
|
const spaceKinds = [RELAY_ADD_MEMBER, RELAY_REMOVE_MEMBER, RELAY_MEMBERS, RELAY_JOIN, RELAY_LEAVE]
|
||||||
const roomKinds = [
|
const roomKinds = [
|
||||||
ROOM_META,
|
ROOM_META,
|
||||||
|
|
@ -83,9 +89,10 @@ const syncEvents = async () => {
|
||||||
|
|
||||||
const rankEvent = (event: TrustedEvent) => {
|
const rankEvent = (event: TrustedEvent) => {
|
||||||
if (metaKinds.includes(event.kind)) return 9
|
if (metaKinds.includes(event.kind)) return 9
|
||||||
if (spaceKinds.includes(event.kind)) return 8
|
if (alertKinds.includes(event.kind)) return 8
|
||||||
if (roomKinds.includes(event.kind)) return 7
|
if (spaceKinds.includes(event.kind)) return 7
|
||||||
if (!isMobile && contentKinds.includes(event.kind)) return 6
|
if (roomKinds.includes(event.kind)) return 6
|
||||||
|
if (!isMobile && contentKinds.includes(event.kind)) return 5
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue