mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 09:28:41 +00:00
small bug fix
This commit is contained in:
parent
bae21c4738
commit
a9572e7890
2 changed files with 6 additions and 5 deletions
|
|
@ -36,9 +36,6 @@ void main() async {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
|
||||||
Hive.init(dir.path);
|
|
||||||
|
|
||||||
await initMediaStorage();
|
await initMediaStorage();
|
||||||
|
|
||||||
dbProvider = DbProvider();
|
dbProvider = DbProvider();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:fixnum/fixnum.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:twonly/main.dart';
|
import 'package:twonly/main.dart';
|
||||||
import 'package:twonly/src/model/json/message.dart';
|
import 'package:twonly/src/model/json/message.dart';
|
||||||
import 'package:twonly/src/model/messages_model.dart';
|
import 'package:twonly/src/model/messages_model.dart';
|
||||||
|
|
@ -109,9 +110,10 @@ Future tryDownloadMedia(List<int> imageToken, {bool force = false}) async {
|
||||||
|
|
||||||
final box = await getMediaStorage();
|
final box = await getMediaStorage();
|
||||||
|
|
||||||
Uint8List imageBytes = Uint8List.fromList([0]);
|
// Uint8List imageBytes = Uint8List.fromList([0]);
|
||||||
|
|
||||||
box.put(imageToken.toString(), imageBytes);
|
// box.put(imageToken.toString(), imageBytes);
|
||||||
|
box.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> isMediaDownloaded(List<int> mediaToken) async {
|
Future<bool> isMediaDownloaded(List<int> mediaToken) async {
|
||||||
|
|
@ -133,6 +135,8 @@ Future initMediaStorage() async {
|
||||||
value: base64UrlEncode(key),
|
value: base64UrlEncode(key),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
|
Hive.init(dir.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Box> getMediaStorage() async {
|
Future<Box> getMediaStorage() async {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue