completed migrating data scope from user to workspace
This commit is contained in:
@@ -127,11 +127,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
});
|
||||
}
|
||||
|
||||
if (prefs.getString("userId") == null) {
|
||||
prefs.setString("userId", Uuid().v4());
|
||||
if (prefs.getString("workspaceId") == null) {
|
||||
prefs.setString("workspaceId", Uuid().v4());
|
||||
}
|
||||
|
||||
await homeController.getTransactions(prefs.getString("userId")!);
|
||||
await homeController.getTransactions(prefs.getString("workspaceId")!);
|
||||
}
|
||||
|
||||
void _onCurrencySelected(String currency) {
|
||||
@@ -155,8 +155,8 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
await homeController.getProviders(_selectedCurrency);
|
||||
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
if (prefs.getString("userId") != null) {
|
||||
await homeController.getTransactions(prefs.getString("userId")!);
|
||||
if (prefs.getString("workspaceId") != null) {
|
||||
await homeController.getTransactions(prefs.getString("workspaceId")!);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,11 +165,11 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
if (location.startsWith('/home')) {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
|
||||
if (prefs.getString("userId") == null) {
|
||||
prefs.setString("userId", Uuid().v4());
|
||||
if (prefs.getString("workspaceId") == null) {
|
||||
prefs.setString("workspaceId", Uuid().v4());
|
||||
}
|
||||
|
||||
await homeController.getTransactions(prefs.getString("userId")!);
|
||||
await homeController.getTransactions(prefs.getString("workspaceId")!);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user