Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Dec 9, 2024
1 parent b7c8d71 commit b6657f0
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ internal class RealtimeChannelImpl(
private val _status = MutableStateFlow(RealtimeChannel.Status.UNSUBSCRIBED)
override val status = _status.asStateFlow()
override val realtime: Realtime = realtimeImpl
private val accessToken = suspend {
realtimeImpl.config.accessToken(supabaseClient) ?: realtimeImpl.accessToken
}
override val supabaseClient = realtimeImpl.supabaseClient

private val broadcastUrl = realtimeImpl.broadcastUrl()
private val subTopic = topic.replaceFirst(Regex("^realtime:", RegexOption.IGNORE_CASE), "")
private val httpClient = realtimeImpl.supabaseClient.httpClient

private suspend fun accessToken() = realtimeImpl.config.accessToken(supabaseClient) ?: realtimeImpl.accessToken

@OptIn(SupabaseInternal::class)
override suspend fun subscribe(blockUntilSubscribed: Boolean) {
if(realtimeImpl.status.value != Realtime.Status.CONNECTED) {
Expand Down

0 comments on commit b6657f0

Please sign in to comment.