mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 09:30:27 +00:00
fix: start duplicate server on mobile when the app is closed by swiping (#370)
This commit is contained in:
2 files changed
+29
-2
No files matched your search
@@ -6,6 +6,7 @@ import 'package:hive/hive.dart';
|
||||
import 'entity.dart';
|
||||
|
||||
const String _startConfig = 'startConfig';
|
||||
const String _lastRunningConfig = 'lastRunningConfig';
|
||||
const String _windowState = 'windowState';
|
||||
const String _bookmark = 'bookmark';
|
||||
const String _createHistory = 'createHistory';
|
||||
@@ -53,6 +54,15 @@ class Database {
|
||||
_startConfig, (json) => StartConfigEntity.fromJson(json));
|
||||
}
|
||||
|
||||
void saveLastRunningConfig(StartConfigEntity entity) {
|
||||
save<StartConfigEntity>(_lastRunningConfig, entity);
|
||||
}
|
||||
|
||||
StartConfigEntity? getLastRunningConfig() {
|
||||
return get<StartConfigEntity>(
|
||||
_lastRunningConfig, (json) => StartConfigEntity.fromJson(json));
|
||||
}
|
||||
|
||||
/// Patch non-null fields with the original value
|
||||
void saveWindowState(WindowStateEntity entity) {
|
||||
final state = getWindowState();
|
||||
|
||||
Reference in new issue
Block a user