Fix ObjectBoxCache creation problem by using ID instead of name

merge-requests/67/merge
Hank Grabowski 2023-03-14 23:08:47 -04:00
rodzic c18581b277
commit 09044702f0
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -17,7 +17,11 @@ class ObjectBoxCache {
final docsDir = await getApplicationSupportDirectory();
final path = p.join(docsDir.path, baseDir, subDir);
Directory(path).createSync(recursive: true);
try {
Directory(path).createSync(recursive: true);
} catch (e) {
_logger.severe('Error creating ObjectCachePathDirectory: $e');
}
_logger.info('ObjectBoxCache path: $path');
final store = await openStore(
directory: path, macosApplicationGroup: 'T69YZGT58U.relatica');

Wyświetl plik

@ -87,7 +87,7 @@ Future<void> dependencyInjectionInitialization() async {
Future<void> updateProfileDependencyInjectors(Profile profile) async {
final objectBox = await ObjectBoxCache.create(
baseDir: 'profileboxcaches',
subDir: '${profile.username}_${profile.serverName}',
subDir: '${profile.id}_${profile.serverName}',
);
final connectionReposSelector =
getIt<ActiveProfileSelector<IConnectionsRepo>>();