fix: improve reservation cleanup and share popup handling
This commit is contained in:
@@ -2284,8 +2284,12 @@ const DownloadTrafficReservationDB = {
|
||||
};
|
||||
},
|
||||
|
||||
cleanupFinalizedHistory(keepDays = 7) {
|
||||
const days = Math.min(365, Math.max(1, Math.floor(Number(keepDays) || 7)));
|
||||
cleanupFinalizedHistory(keepDays = 0) {
|
||||
// keepDays=0 表示立即清理全部已完成历史(confirmed/expired/cancelled)
|
||||
const normalized = Number(keepDays);
|
||||
const days = Number.isFinite(normalized)
|
||||
? Math.min(365, Math.max(0, Math.floor(normalized)))
|
||||
: 0;
|
||||
return db.prepare(`
|
||||
DELETE FROM user_download_traffic_reservations
|
||||
WHERE status IN ('confirmed', 'expired', 'cancelled')
|
||||
|
||||
Reference in New Issue
Block a user