diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-11 20:36:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-11 20:36:55 +0900 |
| commit | 125849673a1aba46021852ee473d00f4520d1bd6 (patch) | |
| tree | e30d39490236df402b97a9963dafa44eaf549368 /src/client/app/desktop/views/widgets | |
| parent | Fix error (diff) | |
| download | misskey-125849673a1aba46021852ee473d00f4520d1bd6.tar.gz misskey-125849673a1aba46021852ee473d00f4520d1bd6.tar.bz2 misskey-125849673a1aba46021852ee473d00f4520d1bd6.zip | |
Use for-of instead of forEach (#3583)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'src/client/app/desktop/views/widgets')
| -rw-r--r-- | src/client/app/desktop/views/widgets/post-form.vue | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/app/desktop/views/widgets/post-form.vue b/src/client/app/desktop/views/widgets/post-form.vue index 5c8d25ac61..622e5c3345 100644 --- a/src/client/app/desktop/views/widgets/post-form.vue +++ b/src/client/app/desktop/views/widgets/post-form.vue @@ -99,7 +99,7 @@ export default define({ this.$chooseDriveFile({ multiple: true }).then(files => { - files.forEach(this.attachMedia); + for (const x of files) this.attachMedia(x); }); }, @@ -118,15 +118,15 @@ export default define({ }, onPaste(e) { - Array.from(e.clipboardData.items).forEach((item: any) => { + for (const item of Array.from(e.clipboardData.items)) { if (item.kind == 'file') { this.upload(item.getAsFile()); } - }); + } }, onChangeFile() { - Array.from((this.$refs.file as any).files).forEach(this.upload); + for (const x of Array.from((this.$refs.file as any).files)) this.upload(x); }, upload(file) { @@ -146,7 +146,7 @@ export default define({ // ファイルだったら if (e.dataTransfer.files.length > 0) { e.preventDefault(); - Array.from(e.dataTransfer.files).forEach(this.upload); + for (const x of Array.from(e.dataTransfer.files)) this.upload(x); return; } |