File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
app/src/main/kotlin/com/d4rk/netprobe/ui/speedtest Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import java.net.InetAddress
2626import java.net.URL
2727
2828class SpeedTestViewModel (application : Application ) : AndroidViewModel(application) {
29- private val coroutineScope = viewModelScope
3029 val downloadSpeed = mutableFloatStateOf(0f )
3130 val maxSpeed = mutableStateOf<String ?>(null )
3231 val ping = mutableStateOf<String ?>(null )
@@ -41,7 +40,7 @@ class SpeedTestViewModel(application: Application) : AndroidViewModel(applicatio
4140 private val checkingString = getApplication<Application >().getString(R .string.checking)
4241
4342 init {
44- coroutineScope .launch {
43+ viewModelScope .launch {
4544 withContext(Dispatchers .Main ) {
4645 speedSmooth.animateTo(downloadSpeed.floatValue)
4746 }
@@ -51,7 +50,7 @@ class SpeedTestViewModel(application: Application) : AndroidViewModel(applicatio
5150 fun startSpeedTest () {
5251 resetStates()
5352 testRunning = true
54- coroutineScope .launch {
53+ viewModelScope .launch {
5554 if (currentScan == 0 ) {
5655 ping.value = checkingString
5756 wifiStrength.value = checkingString
You can’t perform that action at this time.
0 commit comments