From 06f953c1bcebb6086a7c980c4709d7603aa36cf7 Mon Sep 17 00:00:00 2001 From: nyne Date: Mon, 23 Dec 2024 22:52:03 +0800 Subject: [PATCH] fix history length --- lib/foundation/history.dart | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/foundation/history.dart b/lib/foundation/history.dart index 646eecf..1867264 100644 --- a/lib/foundation/history.dart +++ b/lib/foundation/history.dart @@ -201,8 +201,6 @@ class HistoryManager with ChangeNotifier { Map? _cachedHistory; - static const _kMaxHistoryLength = 200; - Future init() async { _db = sqlite3.open("${App.dataPath}/history.db"); @@ -228,12 +226,6 @@ class HistoryManager with ChangeNotifier { /// /// This function would be called when user start reading. Future addHistory(History newItem) async { - while(count() >= _kMaxHistoryLength) { - _db.execute(""" - delete from history - where time == (select min(time) from history); - """); - } _db.execute(""" insert or replace into history (id, title, subtitle, cover, time, type, ep, page, readEpisode, max_page) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);