fix(frontend): まれに設定変更のタブ間同期に失敗する問題を修正 (#16991)
This commit is contained in:
parent
90345591bb
commit
cc05d93194
|
|
@ -257,20 +257,23 @@ export class PreferencesManager extends EventEmitter<PreferencesManagerEvents> {
|
||||||
|
|
||||||
this.rewriteRawState(key, v);
|
this.rewriteRawState(key, v);
|
||||||
|
|
||||||
this.emit('committed', {
|
|
||||||
key,
|
|
||||||
value: v,
|
|
||||||
oldValue: this.s[key],
|
|
||||||
});
|
|
||||||
|
|
||||||
const record = this.getMatchedRecordOf(key);
|
const record = this.getMatchedRecordOf(key);
|
||||||
|
|
||||||
|
const _save = () => {
|
||||||
|
this.save();
|
||||||
|
this.emit('committed', {
|
||||||
|
key,
|
||||||
|
value: v,
|
||||||
|
oldValue: this.s[key],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (parseScope(record[0]).account == null && isAccountDependentKey(key) && currentAccount != null) {
|
if (parseScope(record[0]).account == null && isAccountDependentKey(key) && currentAccount != null) {
|
||||||
this.profile.preferences[key].push([makeScope({
|
this.profile.preferences[key].push([makeScope({
|
||||||
server: host,
|
server: host,
|
||||||
account: currentAccount.id,
|
account: currentAccount.id,
|
||||||
}), v, {}]);
|
}), v, {}]);
|
||||||
this.save();
|
_save();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -278,12 +281,12 @@ export class PreferencesManager extends EventEmitter<PreferencesManagerEvents> {
|
||||||
this.profile.preferences[key].push([makeScope({
|
this.profile.preferences[key].push([makeScope({
|
||||||
server: host,
|
server: host,
|
||||||
}), v, {}]);
|
}), v, {}]);
|
||||||
this.save();
|
_save();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
record[1] = v;
|
record[1] = v;
|
||||||
this.save();
|
_save();
|
||||||
|
|
||||||
if (record[2].sync) {
|
if (record[2].sync) {
|
||||||
// awaitの必要なし
|
// awaitの必要なし
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue