Use for-of instead of forEach (#3583)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp> Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
parent
30c53e9ee0
commit
125849673a
84 changed files with 345 additions and 283 deletions
|
|
@ -136,9 +136,9 @@ export default (os: MiOS) => new Vuex.Store({
|
|||
},
|
||||
|
||||
mergeMe(ctx, me) {
|
||||
Object.entries(me).forEach(([key, value]) => {
|
||||
for (const [key, value] of Object.entries(me)) {
|
||||
ctx.commit('updateIKeyValue', { key, value });
|
||||
});
|
||||
}
|
||||
|
||||
if (me.clientSettings) {
|
||||
ctx.dispatch('settings/merge', me.clientSettings);
|
||||
|
|
@ -215,11 +215,11 @@ export default (os: MiOS) => new Vuex.Store({
|
|||
|
||||
//#region Deck
|
||||
if (state.deck && state.deck.columns) {
|
||||
state.deck.columns.filter(c => c.type == 'widgets').forEach(c => {
|
||||
c.widgets.forEach(w => {
|
||||
if (w.id == x.id) w.data = x.data;
|
||||
});
|
||||
});
|
||||
for (const c of state.deck.columns.filter(c => c.type == 'widgets')) {
|
||||
for (const w of c.widgets.filter(w => w.id == x.id)) {
|
||||
w.data = x.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
},
|
||||
|
|
@ -345,9 +345,9 @@ export default (os: MiOS) => new Vuex.Store({
|
|||
actions: {
|
||||
merge(ctx, settings) {
|
||||
if (settings == null) return;
|
||||
Object.entries(settings).forEach(([key, value]) => {
|
||||
for (const [key, value] of Object.entries(settings)) {
|
||||
ctx.commit('set', { key, value });
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
set(ctx, x) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue