mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-18 05:41:56 +01:00
Fixes recreating the new post screen from intent when switching accounts.
This commit is contained in:
parent
236ff2d680
commit
c5dd2c5651
@ -140,7 +140,10 @@ class Amethyst : Application() {
|
||||
override fun onTrimMemory(level: Int) {
|
||||
super.onTrimMemory(level)
|
||||
println("Trim Memory $level")
|
||||
GlobalScope.launch(Dispatchers.Default) { serviceManager.trimMemory() }
|
||||
GlobalScope.launch(Dispatchers.Default) {
|
||||
println("Trim Memory Inside $level")
|
||||
serviceManager.trimMemory()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -336,13 +336,25 @@ private fun NavigateIfIntentRequested(
|
||||
var newAccount by remember { mutableStateOf<String?>(null) }
|
||||
|
||||
if (activity.intent.action == Intent.ACTION_SEND) {
|
||||
activity.intent.getStringExtra(Intent.EXTRA_TEXT)?.let {
|
||||
nav.newStack(buildNewPostRoute(draftMessage = it))
|
||||
// saves the intent to avoid processing again
|
||||
var message by remember {
|
||||
mutableStateOf(
|
||||
activity.intent.getStringExtra(Intent.EXTRA_TEXT)?.let {
|
||||
it.ifBlank { null }
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
(activity.intent.getParcelableExtra<Parcelable>(Intent.EXTRA_STREAM) as? Uri)?.let {
|
||||
nav.newStack(buildNewPostRoute(attachment = it))
|
||||
var media by remember {
|
||||
mutableStateOf(
|
||||
(activity.intent.getParcelableExtra<Parcelable>(Intent.EXTRA_STREAM) as? Uri),
|
||||
)
|
||||
}
|
||||
|
||||
nav.newStack(buildNewPostRoute(draftMessage = message, attachment = media))
|
||||
|
||||
media = null
|
||||
message = null
|
||||
} else {
|
||||
var currentIntentNextPage by remember {
|
||||
mutableStateOf(
|
||||
|
Loading…
x
Reference in New Issue
Block a user