Fix some issues with launching stuff from shortcuts menu

This commit is contained in:
Mario Danic 2019-12-22 11:59:32 +01:00 committed by Mario Đanić
parent 52f9891939
commit a05f99949c
3 changed files with 8 additions and 9 deletions

View File

@ -82,6 +82,7 @@
<activity <activity
android:name=".activities.MainActivity" android:name=".activities.MainActivity"
android:label="@string/nc_app_label" android:label="@string/nc_app_label"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -86,7 +86,6 @@ class MainActivity : BaseActivity(), ActionBarProvider {
) )
onNewIntent(intent) onNewIntent(intent)
} }
} else { } else {
runOnUiThread { runOnUiThread {
@ -97,10 +96,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
) )
} }
} }
} }
} else {
onNewIntent(intent)
} }
} }
@ -143,7 +139,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
extras.putParcelable(BundleKeys.KEY_USER_ENTITY, it) extras.putParcelable(BundleKeys.KEY_USER_ENTITY, it)
withContext(Dispatchers.Main) { withContext(Dispatchers.Main) {
ConductorRemapping.remapChatController( ConductorRemapping.remapChatController(
router!!, intent.getLongExtra(BundleKeys.KEY_INTERNAL_USER_ID, -1), router!!, it.id!!,
intent.getStringExtra(BundleKeys.KEY_ROOM_TOKEN)!!, extras, false) intent.getStringExtra(BundleKeys.KEY_ROOM_TOKEN)!!, extras, false)
} }
} }

View File

@ -50,13 +50,15 @@ class GlobalService constructor(usersRepository: UsersRepository,
init { init {
currentUserLiveData.observeForever { user -> currentUserLiveData.observeForever { user ->
if (user.id != previousUser?.id) { user?.let {
if (it.id != previousUser?.id) {
cookieManager.cookieStore.removeAll() cookieManager.cookieStore.removeAll()
//okHttpClient.dispatcher().cancelAll() //okHttpClient.dispatcher().cancelAll()
currentConversation = null currentConversation = null
} }
} }
} }
}
suspend fun getConversation(conversationToken: String, globalServiceInterface: GlobalServiceInterface) { suspend fun getConversation(conversationToken: String, globalServiceInterface: GlobalServiceInterface) {
val currentUser = currentUserLiveData.value val currentUser = currentUserLiveData.value