mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 15:46:28 +08:00
fix(account): JSON without label
should not reset label
This commit is contained in:
parent
b3b6276f4e
commit
dc76fc5b98
1 changed files with 6 additions and 4 deletions
|
@ -87,10 +87,12 @@ export default class Account extends ModelWithMetadata {
|
|||
this.syncState = this.syncState || "running";
|
||||
}
|
||||
|
||||
fromJSON(inJSON) {
|
||||
const json = inJSON;
|
||||
json.label = json.label || json[Account.attributes.emailAddress.jsonKey]
|
||||
return super.fromJSON(json)
|
||||
fromJSON(json) {
|
||||
super.fromJSON(json);
|
||||
if (!this.label) {
|
||||
this.label = this.emailAddress;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Returns a {Contact} model that represents the current user.
|
||||
|
|
Loading…
Reference in a new issue