Change localUser path

This commit is contained in:
shilangyu 2021-08-26 00:27:50 +02:00
parent f3cc7f3f99
commit 2ab3d7d657
3 changed files with 7 additions and 6 deletions

View File

@ -34,7 +34,7 @@ class ManageAccountPage extends HookWidget {
final site = await LemmyApiV3(instanceHost).run(GetSite(
auth: accountStore.userDataFor(instanceHost, username)!.jwt.raw));
return site.myUser!;
return site.myUser!.localUserView;
});
void _openMoreMenu() {

View File

@ -191,12 +191,13 @@ class AccountsStore extends ChangeNotifier {
usernameOrEmail: usernameOrEmail,
password: password,
));
final userData =
await lemmy.run(GetSite(auth: jwt.raw)).then((value) => value.myUser!);
final userData = await lemmy
.run(GetSite(auth: jwt.raw))
.then((value) => value.myUser!.localUserView.person);
accounts[instanceHost]![userData.person.name] = UserData(
accounts[instanceHost]![userData.name] = UserData(
jwt: jwt,
userId: userData.person.id,
userId: userData.id,
);
await _assignDefaultAccounts();

View File

@ -119,7 +119,7 @@ class ConfigStore extends ChangeNotifier {
Future<void> importLemmyUserSettings(Jwt token) async {
final site =
await LemmyApiV3(token.payload.iss).run(GetSite(auth: token.raw));
copyLemmyUserSettings(site.myUser!.localUser);
copyLemmyUserSettings(site.myUser!.localUserView.localUser);
}
static Future<ConfigStore> load() async {