mirror of https://github.com/Ashinch/ReadYou.git
fix(ui): remove toast on non-main thread
This commit is contained in:
parent
826819a10b
commit
53aced9085
|
@ -38,7 +38,6 @@ import me.ash.reader.ui.component.base.TextFieldDialog
|
|||
import me.ash.reader.ui.ext.MimeType
|
||||
import me.ash.reader.ui.ext.collectAsStateValue
|
||||
import me.ash.reader.ui.ext.roundClick
|
||||
import me.ash.reader.ui.ext.showToast
|
||||
import me.ash.reader.ui.page.home.feeds.FeedOptionView
|
||||
|
||||
@OptIn(
|
||||
|
@ -57,8 +56,8 @@ fun SubscribeDialog(
|
|||
it?.let { uri ->
|
||||
context.contentResolver.openInputStream(uri)?.let { inputStream ->
|
||||
subscribeViewModel.importFromInputStream(inputStream)
|
||||
} ?: context.showToast("Cannot open Input Stream with content resolver")
|
||||
} ?: context.showToast("Cannot get activity result with launcher")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(subscribeUiState.visible) {
|
||||
|
|
|
@ -110,8 +110,8 @@ fun AccountDetailsPage(
|
|||
result?.let { uri ->
|
||||
context.contentResolver.openOutputStream(uri)?.use { outputStream ->
|
||||
outputStream.write(string.toByteArray())
|
||||
} ?: context.showToast("Cannot open Input Stream with content resolver")
|
||||
} ?: context.showToast("Cannot get activity result with launcher")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ import me.ash.reader.ui.ext.MimeType
|
|||
import me.ash.reader.ui.ext.collectAsStateValue
|
||||
import me.ash.reader.ui.ext.getCurrentVersion
|
||||
import me.ash.reader.ui.ext.openURL
|
||||
import me.ash.reader.ui.ext.showToast
|
||||
import me.ash.reader.ui.ext.toString
|
||||
import me.ash.reader.ui.page.settings.SettingItem
|
||||
import me.ash.reader.ui.theme.palette.onLight
|
||||
|
@ -69,8 +68,8 @@ fun TroubleshootingPage(
|
|||
result?.let { uri ->
|
||||
context.contentResolver.openOutputStream(uri)?.use { outputStream ->
|
||||
outputStream.write(byteArray)
|
||||
} ?: context.showToast("Cannot open Input Stream with content resolver")
|
||||
} ?: context.showToast("Cannot get activity result with launcher")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,8 +80,8 @@ fun TroubleshootingPage(
|
|||
context.contentResolver.openInputStream(uri)?.use { inputStream ->
|
||||
byteArray = inputStream.readBytes()
|
||||
viewModel.tryImport(context, byteArray)
|
||||
} ?: context.showToast("Cannot open Input Stream with content resolver")
|
||||
} ?: context.showToast("Cannot get activity result with launcher")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RYScaffold(
|
||||
|
|
Loading…
Reference in New Issue