web: replace fixed 7 days with trash cleanup interval

This commit is contained in:
Abdullah Atta
2023-03-21 08:06:34 +05:00
parent b44d4702be
commit 9d2bacdc5f
2 changed files with 6 additions and 2 deletions

View File

@@ -209,8 +209,9 @@ export function showError(title: string, message: string) {
export function showMultiDeleteConfirmation(length: number) {
return confirm({
title: `Delete ${length} items?`,
message:
"These items will be **kept in your Trash for 7 days** after which they will be permanently deleted.",
message: `These items will be **kept in your Trash for ${
db.settings?.getTrashCleanupInterval() || 7
} days** after which they will be permanently deleted.`,
positiveButtonText: "Yes",
negativeButtonText: "No"
});

View File

@@ -133,6 +133,9 @@ class Settings {
await this._saveSettings();
}
/**
* @returns {7 | 30 | 365 | -1}
*/
getTrashCleanupInterval() {
return this._settings.trashCleanupInterval || 7;
}