From f7b1b9072cc32d1c5a107bb546738680d40127aa Mon Sep 17 00:00:00 2001 From: dece Date: Fri, 18 Feb 2022 21:36:14 +0100 Subject: [PATCH] PageFragment: do not count URL as visited twice --- app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt index 6cb6a64..7ad0e44 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt @@ -157,7 +157,8 @@ class PageFragment : Fragment(), PageAdapter.Listener { } is PageViewModel.SuccessEvent -> { vm.currentUrl = event.uri - vm.visitedUrls.add(event.uri) + if (vm.visitedUrls.isEmpty() || vm.visitedUrls.last() != event.uri) + vm.visitedUrls.add(event.uri) binding.addressBar.setText(event.uri) } is PageViewModel.BinaryEvent -> {