Skip to content

Commit

Permalink
fix_: Profile name not displayed on the login page for synced device …
Browse files Browse the repository at this point in the history
…in falback flow
  • Loading branch information
Parveshdhull committed Sep 25, 2024
1 parent c1ce30a commit b95460e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ func TestRestoreAccountAndLogin(t *testing.T) {
Mnemonic: "test test test test test test test test test test test test",
FetchBackup: false,
CreateAccount: requests.CreateAccount{
DisplayName: "Account1",
DeviceName: "StatusIM",
Password: "password",
CustomizationColor: "0x000000",
Expand All @@ -1647,6 +1646,7 @@ func TestRestoreAccountAndLogin(t *testing.T) {
account, err := backend.RestoreAccountAndLogin(restoreRequest)
require.NoError(t, err)
require.NotNil(t, account)
require.NotEmpty(t, account.Name)

// Test case 2: Invalid restore account request
invalidRequest := &requests.RestoreAccount{}
Expand Down
4 changes: 4 additions & 0 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,10 @@ func (b *GethStatusBackend) prepareNodeAccount(request *requests.CreateAccount,
return nil, errors.Wrap(err, "failed to prepare settings")
}

if response.account.Name == "" {
response.account.Name = response.settings.Name
}

response.nodeConfig, err = b.prepareConfig(request, input, response.settings.InstallationID)
if err != nil {
return nil, errors.Wrap(err, "failed to prepare node config")
Expand Down

0 comments on commit b95460e

Please sign in to comment.