Skip to content

Commit 257b646

Browse files
committed
fixed change in directory creating Storage miss
1 parent 8ee37ec commit 257b646

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

lib/app/modules/home/controllers/home_controller.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,16 @@ class HomeController extends GetxController {
631631
_refreshTasks();
632632
}
633633

634+
void changeInDirectory() {
635+
print("directory change to ${splashController.baseDirectory.value.path}");
636+
storage = Storage(
637+
Directory(
638+
'${splashController.baseDirectory.value.path}/profiles/${splashController.currentProfile.value}',
639+
),
640+
);
641+
_refreshTasks();
642+
}
643+
634644
RxBool useDelayTask = false.obs;
635645

636646
Future<void> loadDelayTask() async {

lib/app/modules/splash/controllers/splash_controller.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class SplashController extends GetxController {
5959
void setBaseDirectory(Directory newBaseDirectory) {
6060
baseDirectory.value = newBaseDirectory;
6161
profilesMap.value = _profiles.profilesMap();
62+
Get.find<HomeController>().changeInDirectory();
6263
}
6364

6465
void addProfile() {

lib/app/utils/taskfunctions/profiles.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import 'dart:collection';
44
import 'dart:io';
55

6+
import 'package:flutter/widgets.dart';
67
import 'package:sqflite/sqflite.dart';
78
import 'package:taskwarrior/app/models/storage.dart';
89
import 'package:uuid/uuid.dart';
@@ -71,6 +72,7 @@ class Profiles {
7172
entity.uri.pathSegments.lastWhere((segment) => segment.isNotEmpty))
7273
.toList()
7374
..sort(comparator);
75+
debugPrint('Profiles found: $dirs');
7476
return dirs;
7577
}
7678

0 commit comments

Comments
 (0)