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:
Aya Morisawa
2018-12-11 20:36:55 +09:00
committed by GitHub
parent 30c53e9ee0
commit 125849673a
84 changed files with 345 additions and 283 deletions

View File

@ -59,11 +59,11 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
//#region Deck
if (widget == null && user.clientSettings.deck && user.clientSettings.deck.columns) {
const deck = user.clientSettings.deck;
deck.columns.filter((c: any) => c.type == 'widgets').forEach((c: any) => {
c.widgets.forEach((w: any) => {
if (w.id == ps.id) widget = w;
});
});
for (const c of deck.columns.filter((c: any) => c.type == 'widgets')) {
for (const w of c.widgets.filter((w: any) => w.id == ps.id)) {
widget = w;
}
}
if (widget) {
widget.data = ps.data;