From edef613dc874560809042e99e829c2e1ca1fe2ff Mon Sep 17 00:00:00 2001 From: jahorton Date: Tue, 14 Jun 2022 15:16:00 +0700 Subject: [PATCH] change(web): implements arrow-func suggestion from #6567 --- web/source/keyboards/kmwkeyboards.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/source/keyboards/kmwkeyboards.ts b/web/source/keyboards/kmwkeyboards.ts index 3fddf7543c..8b33cc9f1f 100644 --- a/web/source/keyboards/kmwkeyboards.ts +++ b/web/source/keyboards/kmwkeyboards.ts @@ -271,13 +271,10 @@ namespace com.keyman.keyboards { for(Ln=0; Ln < this.keyboardStubs.length; Ln++) { // I1511 - array prototype extended Lstub = this.keyboardStubs[Ln]; - let Lkbd; - for(let kbdIndex=0; kbdIndex < this.keyboards.length; kbdIndex++) { - if(this.keyboards[kbdIndex]['KI'] == Lstub['KI']) { - Lkbd = this.keyboards[kbdIndex]; - break; - } - } + + // In Chrome, (including on Android), Array.prototype.find() requires Chrome 45. + // This is a later version than the default on our oldest-supported Android devices. + const Lkbd = this.keyboards.find(k => k['KI'] == Lstub['KI']); Lrn = this._GetKeyboardDetail(Lstub, Lkbd); // I2078 - Full keyboard detail Lr=this.keymanweb._push(Lr,Lrn); // TODO: Resolve without need for the cast. }