Clear progress on delete
This commit is contained in:
@@ -3,9 +3,15 @@
|
||||
import { db } from '$lib/catalog/db';
|
||||
import { promptConfirmation } from '$lib/util';
|
||||
import { goto } from '$app/navigation';
|
||||
import { clearVolumes } from '$lib/settings';
|
||||
|
||||
function onConfirm() {
|
||||
clearVolumes();
|
||||
db.catalog.clear();
|
||||
}
|
||||
|
||||
function onClear() {
|
||||
promptConfirmation('Are you sure you want to clear your catalog?', () => db.catalog.clear());
|
||||
promptConfirmation('Are you sure you want to clear your catalog?', onConfirm);
|
||||
goto('/');
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -44,6 +44,17 @@ export function initializeVolume(volume: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteVolume(volume: string) {
|
||||
volumes.update((prev) => {
|
||||
delete prev[volume]
|
||||
return prev
|
||||
})
|
||||
}
|
||||
|
||||
export function clearVolumes() {
|
||||
volumes.set({});
|
||||
}
|
||||
|
||||
export function updateProgress(volume: string, progress: number, chars: number, completed = false) {
|
||||
volumes.update((prev) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user