Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit f9c92a2

Browse files
keianhzoMortimerGoro
authored andcommitted
Avoid double removing items when deleting (#2658)
1 parent 2868a7e commit f9c92a2

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/views/BookmarksView.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ public void onClick(@NonNull View view, @NonNull Bookmark item) {
164164
public void onDelete(@NonNull View view, @NonNull Bookmark item) {
165165
mBinding.bookmarksList.requestFocusFromTouch();
166166

167-
mBookmarkAdapter.removeItem(item);
168-
if (mBookmarkAdapter.itemCount() == 0) {
169-
mBinding.setIsEmpty(true);
170-
mBinding.setIsLoading(false);
171-
mBinding.executePendingBindings();
172-
}
173-
174167
SessionStore.get().getBookmarkStore().deleteBookmarkById(item.getGuid());
175168
}
176169

app/src/common/shared/org/mozilla/vrbrowser/ui/views/HistoryView.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ public void onClick(View view, VisitInfo item) {
167167
public void onDelete(View view, VisitInfo item) {
168168
mBinding.historyList.requestFocusFromTouch();
169169

170-
mHistoryAdapter.removeItem(item);
171-
if (mHistoryAdapter.itemCount() == 0) {
172-
mBinding.setIsEmpty(true);
173-
mBinding.setIsLoading(false);
174-
mBinding.executePendingBindings();
175-
}
176-
177170
SessionStore.get().getHistoryStore().deleteVisitsFor(item.getUrl());
178171
}
179172

@@ -381,7 +374,6 @@ private void showHistory(List<VisitInfo> historyItems) {
381374
mBinding.setIsEmpty(false);
382375
mBinding.setIsLoading(false);
383376
mHistoryAdapter.setHistoryList(historyItems);
384-
mBinding.historyList.post(() -> mBinding.historyList.smoothScrollToPosition(0));
385377
}
386378
}
387379

0 commit comments

Comments
 (0)