Skip to content

Commit

Permalink
fix null error in JS logger when inserting PPT files
Browse files Browse the repository at this point in the history
  • Loading branch information
aderan committed Sep 19, 2024
1 parent cf011fb commit e4b66a2
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 54 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ dependencies {
api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.8.0'

// Agora
implementation("com.github.netless-io:whiteboard-android:nl_2.17.0-alpha.14") {
implementation("com.github.netless-io:whiteboard-android:nl_2.17.0-alpha.15") {
force true
}
// for local fastboard debug
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/assets/flatboard/b280a53
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
here are what injected into build
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
@netless/[email protected]
104 changes: 52 additions & 52 deletions app/src/main/assets/flatboard/whiteboard-bridge.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class AgoraBoardRoom @Inject constructor(
override fun onFastError(error: FastException) {
if (error.code == FastException.ROOM_KICKED) {
boardError.value = BoardError.Kicked
} else {
boardError.value = BoardError.Unknown(error.message ?: "Unknown error")
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ sealed class BoardPhase {

sealed class BoardError {
object Kicked : BoardError()
data class Unknown(val message: String) : BoardError()
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class ExtComponent(
showLoading(it.loading)
it.error?.run {
handleErrorMessage(it.error)
viewModel.clearError()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import javax.inject.Inject
class ExtensionViewModel @Inject constructor(
private val errorManager: RoomErrorManager,
private val boardRoom: AgoraBoardRoom,
private val eventBus: EventBus
private val eventBus: EventBus,
) : ViewModel() {
private val _state = MutableStateFlow(ExtensionState())
val state = _state.asStateFlow()
Expand Down Expand Up @@ -51,6 +51,10 @@ class ExtensionViewModel @Inject constructor(
is BoardError.Kicked -> {
eventBus.produceEvent(RoomKickedEvent)
}

is BoardError.Unknown -> {
_state.value = _state.value.copy(error = UiMessage(error.message))
}
}
}
}
Expand All @@ -61,6 +65,10 @@ class ExtensionViewModel @Inject constructor(
}
}
}

fun clearError() {
_state.value = _state.value.copy(error = null)
}
}

data class ExtensionState(
Expand Down

0 comments on commit e4b66a2

Please sign in to comment.