mirror of
https://github.com/immich-app/immich.git
synced 2026-04-16 23:51:55 -04:00
* refactor: yank old timeline # Conflicts: # mobile/lib/presentation/pages/editing/drift_edit.page.dart # mobile/lib/providers/websocket.provider.dart # mobile/lib/routing/router.dart * more cleanup * remove native code * chore: bump sqlite-data version * remove old background tasks from BGTaskSchedulerPermittedIdentifiers * rebase --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
24 lines
798 B
Dart
24 lines
798 B
Dart
import 'dart:async';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.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;
|
|
}
|
|
}
|
|
}
|