Use TrustedEvent
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {get} from "svelte/store"
|
import {get} from "svelte/store"
|
||||||
import type {Snippet} from "svelte"
|
import type {Snippet} from "svelte"
|
||||||
import {assoc, append, nth, type Maybe, uniqBy} from "@welshman/lib"
|
import {assoc, append, nth, uniqBy} from "@welshman/lib"
|
||||||
import type {RoomMeta} from "@welshman/util"
|
import type {RoomMeta, TrustedEvent} from "@welshman/util"
|
||||||
import {getTag, makeRoomMeta} from "@welshman/util"
|
import {getTag, makeRoomMeta} from "@welshman/util"
|
||||||
import {waitForThunkError, createRoom, editRoom, joinRoom} from "@welshman/app"
|
import {waitForThunkError, createRoom, editRoom, joinRoom} from "@welshman/app"
|
||||||
import StickerSmileSquare from "@assets/icons/sticker-smile-square.svg?dataurl"
|
import StickerSmileSquare from "@assets/icons/sticker-smile-square.svg?dataurl"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
type RoomMode = "text" | "voice" | "both"
|
type RoomMode = "text" | "voice" | "both"
|
||||||
|
|
||||||
const getRoomModeFromEvent = (event: Maybe<{tags: Maybe<string[][]>}>): RoomMode => {
|
const getRoomModeFromEvent = (event?: TrustedEvent): RoomMode => {
|
||||||
const tags = event?.tags ?? []
|
const tags = event?.tags ?? []
|
||||||
const hasLivekit = !!getTag("livekit", tags)
|
const hasLivekit = !!getTag("livekit", tags)
|
||||||
const hasNoText = !!getTag("no-text", tags)
|
const hasNoText = !!getTag("no-text", tags)
|
||||||
|
|||||||
Reference in New Issue
Block a user