Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
28
lib/Peach/see/history/ViewHistory.dart
Normal file
28
lib/Peach/see/history/ViewHistory.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import '../parent/ParentViewModel.dart';
|
||||
import 'ConnectHistory.dart';
|
||||
|
||||
class ViewHistory extends ParentViewModel {
|
||||
ConnectHistory connection;
|
||||
|
||||
ViewHistory(super.context, this.connection);
|
||||
|
||||
void loadHistory() async {
|
||||
try {
|
||||
final history = await getDataManager().getDeployments();
|
||||
connection.onHistoryLoaded(history);
|
||||
} catch (error) {
|
||||
handleError(error, loadHistory, () {}, "Retry");
|
||||
}
|
||||
}
|
||||
|
||||
void clearHistory() async {
|
||||
showLoading("Clearing history …");
|
||||
try {
|
||||
await getDataManager().clearDeployments();
|
||||
closeLoading();
|
||||
connection.onHistoryCleared();
|
||||
} catch (error) {
|
||||
handleError(error, clearHistory, () {}, "Retry");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user