Skip to content

Commit d0d7ec2

Browse files
committed
fix
1 parent cf6111e commit d0d7ec2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/pages/fontManager/fontManager.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,18 @@ export default function fontManager() {
6262
const fontNames = fonts.getNames();
6363
let $currentItem;
6464
const content = [];
65+
const defaultAppliedTargets = getAppliedTargets("");
6566

6667
const $defaultItem = (
6768
<FontItem
6869
name={defaultAppFontLabel}
69-
appliedTargets={getAppliedTargets("")}
70+
appliedTargets={defaultAppliedTargets}
7071
subtitle="System default app font"
7172
deletable={false}
7273
onSelect={() => chooseApplyTarget("")}
7374
/>
7475
);
75-
if (getAppliedTargets("").length) $currentItem = $defaultItem;
76+
if (defaultAppliedTargets.length) $currentItem = $defaultItem;
7677
content.push($defaultItem);
7778

7879
fontNames.forEach((fontName) => {
@@ -248,8 +249,22 @@ export default function fontManager() {
248249
}
249250

250251
function getTargetOptionText(fontName, target) {
251-
const action = fontName ? "Apply" : "Reset";
252-
return `${action} to ${targetLabels[target]}`;
252+
if (fontName) {
253+
return `Apply to ${targetLabels[target]}`;
254+
}
255+
256+
switch (target) {
257+
case "app":
258+
return "Reset App font";
259+
case "editor":
260+
return "Reset Editor font";
261+
case "terminal":
262+
return "Reset Terminal font";
263+
case "all":
264+
return "Reset all fonts";
265+
default:
266+
return "Reset font";
267+
}
253268
}
254269

255270
async function chooseApplyTarget(fontName) {

0 commit comments

Comments
 (0)