Files
PeachDeployments/lib/Peach/see/history/ViewHistory.dart
alvocool 38881d1fe1 Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:15:30 +03:00

29 lines
706 B
Dart

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");
}
}
}