mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 23:54:13 +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";
|
this.syncState = this.syncState || "running";
|
||||||
}
|
}
|
||||||
|
|
||||||
fromJSON(inJSON) {
|
fromJSON(json) {
|
||||||
const json = inJSON;
|
super.fromJSON(json);
|
||||||
json.label = json.label || json[Account.attributes.emailAddress.jsonKey]
|
if (!this.label) {
|
||||||
return super.fromJSON(json)
|
this.label = this.emailAddress;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a {Contact} model that represents the current user.
|
// Returns a {Contact} model that represents the current user.
|
||||||
|
|
Loading…
Reference in a new issue