File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
appnav/src/main/kotlin/io/element/android/appnav/root Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class RootNavStateFlowFactory(
5757 * @return a flow of integer, where each time a clear cache is done, we have a new incremented value.
5858 */
5959 private fun cacheIndexFlow (savedStateMap : SavedStateMap ? ): Flow <Int > {
60- val initialCacheIndex = savedStateMap.getCacheIndexOrDefault ()
60+ val initialCacheIndex = savedStateMap.getUpdatedCacheIndexOrDefault ()
6161 return cacheService.clearedCacheEventFlow
6262 .onEach { sessionId ->
6363 matrixSessionCache.remove(sessionId)
@@ -83,7 +83,7 @@ class RootNavStateFlowFactory(
8383 }
8484 }
8585
86- private fun SavedStateMap?.getCacheIndexOrDefault (): Int {
87- return this ?.get(SAVE_INSTANCE_KEY ) as ? Int ? : 0
86+ private fun SavedStateMap?.getUpdatedCacheIndexOrDefault (): Int {
87+ return ( this ?.get(SAVE_INSTANCE_KEY ) as ? Int )?. let { it + 1 } ? : 0
8888 }
8989}
You can’t perform that action at this time.
0 commit comments