Skip to content

Commit

Permalink
Don't mutate the input in the Font Context constructor (#2550)
Browse files Browse the repository at this point in the history
Fixes analysis language order-switch bug.
  • Loading branch information
imnasnainaec authored Sep 8, 2023
1 parent e591f45 commit 1dc49fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilities/fontContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export class ProjectFonts {
return;
}

proj.analysisWritingSystems.reverse().forEach((ws) => {
proj.analysisWritingSystems.forEach((ws) => {
const font = ws.font.replaceAll(" ", "");
if (font) {
if (font && !(ws.bcp47 in this.langMap)) {
this.langMap[ws.bcp47] = font;
if (ws.rtl) {
this.rtlLangs[ws.bcp47] = true;
Expand Down

0 comments on commit 1dc49fb

Please sign in to comment.