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

Fixes #2408 Fixes #2653 Avoid double removing items when deleting #2658

Merged
merged 1 commit into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,6 @@ public void onClick(@NonNull View view, @NonNull Bookmark item) {
public void onDelete(@NonNull View view, @NonNull Bookmark item) {
mBinding.bookmarksList.requestFocusFromTouch();

mBookmarkAdapter.removeItem(item);
if (mBookmarkAdapter.itemCount() == 0) {
mBinding.setIsEmpty(true);
mBinding.setIsLoading(false);
mBinding.executePendingBindings();
}

SessionStore.get().getBookmarkStore().deleteBookmarkById(item.getGuid());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ public void onClick(View view, VisitInfo item) {
public void onDelete(View view, VisitInfo item) {
mBinding.historyList.requestFocusFromTouch();

mHistoryAdapter.removeItem(item);
if (mHistoryAdapter.itemCount() == 0) {
mBinding.setIsEmpty(true);
mBinding.setIsLoading(false);
mBinding.executePendingBindings();
}

SessionStore.get().getHistoryStore().deleteVisitsFor(item.getUrl());
}

Expand Down Expand Up @@ -381,7 +374,6 @@ private void showHistory(List<VisitInfo> historyItems) {
mBinding.setIsEmpty(false);
mBinding.setIsLoading(false);
mHistoryAdapter.setHistoryList(historyItems);
mBinding.historyList.post(() -> mBinding.historyList.smoothScrollToPosition(0));
}
}

Expand Down