mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
7a923659d1
# Conflicts: # mobile/lib/presentation/widgets/asset_viewer/asset_page.widget.dart
24 lines
790 B
Dart
24 lines
790 B
Dart
import 'dart:async';
|
|
|
|
import 'package:hooks_riverpod/legacy.dart';
|
|
import 'package:immich_mobile/models/server_info/server_disk_info.model.dart';
|
|
import 'package:immich_mobile/services/server_info.service.dart';
|
|
|
|
final backupProvider = StateNotifierProvider<BackupNotifier, ServerDiskInfo>((ref) {
|
|
return BackupNotifier(ref.watch(serverInfoServiceProvider));
|
|
});
|
|
|
|
class BackupNotifier extends StateNotifier<ServerDiskInfo> {
|
|
BackupNotifier(this._serverInfoService)
|
|
: super(const ServerDiskInfo(diskAvailable: "0", diskSize: "0", diskUse: "0", diskUsagePercentage: 0));
|
|
|
|
final ServerInfoService _serverInfoService;
|
|
|
|
Future<void> updateDiskInfo() async {
|
|
final diskInfo = await _serverInfoService.getDiskInfo();
|
|
if (diskInfo != null) {
|
|
state = diskInfo;
|
|
}
|
|
}
|
|
}
|