Long value to String 2

This commit is contained in:
Niktia 2025-02-20 11:08:38 +03:00
parent 536f9eb83a
commit 8c92180a56
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ class QrResultFragment : Fragment(R.layout.fragment_qr_result) {
if (key == QrScanDestination.REQUEST_KEY) { if (key == QrScanDestination.REQUEST_KEY) {
val code = QrScanDestination.getDataIfExist(bundle) val code = QrScanDestination.getDataIfExist(bundle)
if (code != null) { if (code != null) {
viewModel.sendResult(code.toLong()) viewModel.sendResult(code.toString())
} }
} }
} }

View File

@ -26,7 +26,7 @@ class QrResultViewModel(
private val _state = MutableStateFlow<State>(State.Loading) private val _state = MutableStateFlow<State>(State.Loading)
val state = _state.asStateFlow() val state = _state.asStateFlow()
fun updateState(code: Long?) { fun updateState(code: String?) {
viewModelScope.launch { viewModelScope.launch {
_state.emit(State.Loading) _state.emit(State.Loading)
if (code == null) { if (code == null) {
@ -54,7 +54,7 @@ class QrResultViewModel(
} }
} }
fun sendResult(code : Long) { fun sendResult(code : String) {
updateState(code) updateState(code)
} }