diff --git a/lib/stores/accounts_store.dart b/lib/stores/accounts_store.dart index 8e4c7f2..6166f1d 100644 --- a/lib/stores/accounts_store.dart +++ b/lib/stores/accounts_store.dart @@ -11,7 +11,7 @@ part 'accounts_store.g.dart'; /// Store that manages all accounts @JsonSerializable() class AccountsStore extends ChangeNotifier { - static const prefsKey = 'v2:AccountsStore'; + static const prefsKey = 'v3:AccountsStore'; static final _prefs = SharedPreferences.getInstance(); /// Map containing JWT tokens of specific users. @@ -206,7 +206,9 @@ class AccountsStore extends ChangeNotifier { final userData = await lemmy.run(GetSite(auth: token.raw)).then((value) => value.myUser); - tokens[instanceHost][userData.person.name] = token; + tokens[instanceHost][userData.person.name] = token.copyWith( + payload: token.payload.copyWith(sub: userData.person.id), + ); await _assignDefaultAccounts(); notifyListeners(); diff --git a/pubspec.lock b/pubspec.lock index 2c80694..5c24b4b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -412,7 +412,7 @@ packages: name: lemmy_api_client url: "https://pub.dartlang.org" source: hosted - version: "0.13.0" + version: "0.14.0" logging: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 14eae0b..b5b2e59 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,7 +44,7 @@ dependencies: # utils timeago: ^2.0.27 fuzzy: <1.0.0 - lemmy_api_client: ^0.13.0 + lemmy_api_client: ^0.14.0 intl: ^0.17.0 matrix4_transform: ^1.1.7 json_annotation: ^4.0.1