feature/23-voice-room/poc #93
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {ifLet} from "@welshman/lib"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import Microphone from "@assets/icons/microphone.svg?dataurl"
|
||||
import MicrophoneOff from "@assets/icons/microphone-off.svg?dataurl"
|
||||
@@ -8,6 +9,7 @@
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import {displayRoom} from "@app/core/state"
|
||||
import RoomDetail from "@app/components/RoomDetail.svelte"
|
||||
import type {VoiceSession} from "@app/voice"
|
||||
import {currentVoiceSession, leaveVoiceRoom, toggleMute} from "@app/voice"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
|
||||
@@ -17,8 +19,9 @@
|
||||
const spaceName = $derived($currentVoiceSession ? displayRelayUrl($currentVoiceSession.url) : "")
|
||||
|
||||
const showRoomDetail = () => {
|
||||
|
hodlbod marked this conversation as resolved
Outdated
|
||||
const session = $currentVoiceSession
|
||||
if (session) pushModal(RoomDetail, {url: session.url, h: session.h})
|
||||
ifLet($currentVoiceSession, (session: VoiceSession) =>
|
||||
pushModal(RoomDetail, {url: session.url, h: session.h}),
|
||||
)
|
||||
|
hodlbod marked this conversation as resolved
Outdated
hodlbod
commented
$currentVoiceSession is better than $currentVoiceSession is better than `get`
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user
Don't do indirection like this, just call the actual function
A stupid way to do this that I like would be
ifLet($currentVoiceSession, ({url, h}) => pushModal(RoomDetail, {url, h}))but you don't have to do thatIt is harder to read at first glance but
ifLetbrings warm feelings from better programming languages so it's done.