Skip to content

Commit 38ed07c

Browse files
ix5TobiGr
authored andcommitted
Downloader: Deleter: Dismiss previous Snackbars
Bug: In Downloader view, while deleting items, Snackbars at the bottom of the UI keep queuing up. You need to wait for all of them to dismiss themselves for files to actually be deleted. If you close NewPipe before all snackbars are dismissed, your files will not be deleted and show up again next time you start NewPipe. Fix: When running append(), trigger the commit() action immediately and cancel all delayed callbacks for commit(). This prevents Snackbars from stacking up in reverse order. Fixes: #5660
1 parent 72ee4be commit 38ed07c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/src/main/java/us/shandian/giga/ui/common/Deleter.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public Deleter(View v, Context c, MissionAdapter a, DownloadManager d, MissionIt
5555
}
5656

5757
public void append(Mission item) {
58+
59+
/* If a mission is removed from the list while the Snackbar for a previously
60+
* removed item is still showing, commit the action for the previous item
61+
* immediately. This prevents Snackbars from stacking up in reverse order.
62+
*/
63+
mHandler.removeCallbacks(rCommit);
64+
commit();
65+
5866
mIterator.hide(item);
5967
items.add(0, item);
6068

0 commit comments

Comments
 (0)