From 338a774590af8336e9ca3c08b3933e69dcccef9a Mon Sep 17 00:00:00 2001 From: Patrick Kettner Date: Thu, 30 Nov 2023 10:59:06 -0500 Subject: [PATCH] feedback --- .../fontSettings Advanced/options.js | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/api-samples/fontSettings/fontSettings Advanced/options.js b/api-samples/fontSettings/fontSettings Advanced/options.js index d729a30f08..f290cac63b 100644 --- a/api-samples/fontSettings/fontSettings Advanced/options.js +++ b/api-samples/fontSettings/fontSettings Advanced/options.js @@ -688,21 +688,23 @@ advancedFonts.applyImportedSettings = async function (config) { if (Array.isArray(config.configuredFonts)) { config.configuredFonts.forEach(({ script, scriptData }) => { - scriptData.forEach(async ({ fontId, genericFamily }) => { - if (isString(fontId, genericFamily, script)) { - try { - await chrome.fontSettings.setFont({ - fontId, - genericFamily, - script - }); - } catch (e) { - console.warn( - `Unable to set ${script},${fonId},${genericFamily}: ${e}` - ); + if (Array.isArray(scriptData)) { + scriptData.forEach(async ({ fontId, genericFamily }) => { + if (isString(fontId, genericFamily, script)) { + try { + await chrome.fontSettings.setFont({ + fontId, + genericFamily, + script + }); + } catch (e) { + console.warn( + `Unable to set ${script},${fonId},${genericFamily}: ${e}` + ); + } } - } - }); + }); + } }); } else if (typeof config.configuredFonts !== 'undefined') { console.error(