Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkettner committed Nov 30, 2023
1 parent 7c3700b commit 338a774
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions api-samples/fontSettings/fontSettings Advanced/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 338a774

Please sign in to comment.