mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(mobile): migrate all Hive boxes to Isar database (#2036)
This commit is contained in:
parent
0616a66b05
commit
eccde8fa07
33 changed files with 1540 additions and 383 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:immich_mobile/constants/hive_box.dart';
|
||||
import 'package:immich_mobile/shared/models/store.dart';
|
||||
import 'package:immich_mobile/shared/views/version_announcement_overlay.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
|
|
@ -13,10 +12,10 @@ class ReleaseInfoNotifier extends StateNotifier<String> {
|
|||
final log = Logger('ReleaseInfoNotifier');
|
||||
void checkGithubReleaseInfo() async {
|
||||
final Client client = Client();
|
||||
var box = Hive.box(hiveGithubReleaseInfoBox);
|
||||
|
||||
try {
|
||||
String? localReleaseVersion = box.get(githubReleaseInfoKey);
|
||||
final String? localReleaseVersion =
|
||||
Store.tryGet(StoreKey.githubReleaseInfo);
|
||||
final res = await client.get(
|
||||
Uri.parse(
|
||||
"https://api.github.com/repos/immich-app/immich/releases/latest",
|
||||
|
|
@ -48,9 +47,7 @@ class ReleaseInfoNotifier extends StateNotifier<String> {
|
|||
}
|
||||
|
||||
void acknowledgeNewVersion() {
|
||||
var box = Hive.box(hiveGithubReleaseInfoBox);
|
||||
|
||||
box.put(githubReleaseInfoKey, state);
|
||||
Store.put(StoreKey.githubReleaseInfo, state);
|
||||
VersionAnnouncementOverlayController.appLoader.hide();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue