From e458d8b6a161b749d5f45cb334a0f1eac7328fa9 Mon Sep 17 00:00:00 2001 From: Andrei Teslovan Date: Thu, 13 Jun 2019 18:52:35 +0300 Subject: [PATCH] Fixes #3365 - Set selectedFolder to null if it's already selected (#3415) --- .../bookmarks/selectfolder/SelectBookmarkFolderAdapter.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/selectfolder/SelectBookmarkFolderAdapter.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/selectfolder/SelectBookmarkFolderAdapter.kt index 3651d086f4..e05916f52e 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/selectfolder/SelectBookmarkFolderAdapter.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/selectfolder/SelectBookmarkFolderAdapter.kt @@ -58,7 +58,12 @@ class SelectBookmarkFolderAdapter(private val sharedViewModel: BookmarksSharedVi tree[position].node == sharedViewModel.selectedFolder, object : SelectionInterface { override fun itemSelected(node: BookmarkNode) { - sharedViewModel.selectedFolder = node + sharedViewModel.apply { + when (selectedFolder) { + node -> selectedFolder = null + else -> selectedFolder = node + } + } notifyDataSetChanged() } })