From 31984a57d6a35eb22c4d9e2aa6c4533dbfbabae6 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Sat, 11 Jul 2020 12:46:10 +0200 Subject: [PATCH] Subscribe to view model is already disposed --- .../riotx/features/home/HomeDetailFragment.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt index f0fdc207f9..770b03d345 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt @@ -193,14 +193,15 @@ class HomeDetailFragment @Inject constructor( } private fun setupKeysBackupBanner() { - serverBackupStatusViewModel.subscribe(this) { - when (val banState = it.bannerState.invoke()) { - is BannerState.Setup -> homeKeysBackupBanner.render(KeysBackupBanner.State.Setup(banState.numberOfKeys), false) - BannerState.BackingUp -> homeKeysBackupBanner.render(KeysBackupBanner.State.BackingUp, false) - null, - BannerState.Hidden -> homeKeysBackupBanner.render(KeysBackupBanner.State.Hidden, false) - } - }.disposeOnDestroyView() + serverBackupStatusViewModel + .subscribe(this) { + when (val banState = it.bannerState.invoke()) { + is BannerState.Setup -> homeKeysBackupBanner.render(KeysBackupBanner.State.Setup(banState.numberOfKeys), false) + BannerState.BackingUp -> homeKeysBackupBanner.render(KeysBackupBanner.State.BackingUp, false) + null, + BannerState.Hidden -> homeKeysBackupBanner.render(KeysBackupBanner.State.Hidden, false) + } + } homeKeysBackupBanner.delegate = this }