Skip to content

Commit 6863c4b

Browse files
committed
fix(settings): issue with icon in title when switching emoji style (#466)
1 parent 98b49ba commit 6863c4b

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/settings/ui/emojiStyle.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,31 @@ export default class EmojiStyleSetting extends IconFolderSetting {
4747

4848
if (emoji.isEmoji(iconName)) {
4949
dom.createIconNode(this.plugin, path, iconName);
50-
const tabLeaves = iconTabs.getTabLeavesOfFilePath(this.plugin, path);
51-
for (const tabLeaf of tabLeaves) {
52-
iconTabs.update(
50+
if (this.plugin.getSettings().iconInTabsEnabled) {
51+
const tabLeaves = iconTabs.getTabLeavesOfFilePath(
5352
this.plugin,
54-
iconName,
55-
tabLeaf.tabHeaderInnerIconEl,
53+
path,
5654
);
55+
for (const tabLeaf of tabLeaves) {
56+
iconTabs.update(
57+
this.plugin,
58+
iconName,
59+
tabLeaf.tabHeaderInnerIconEl,
60+
);
61+
}
5762
}
5863

59-
for (const openedFile of getAllOpenedFiles(this.plugin)) {
60-
const activeView = openedFile.leaf.view as InlineTitleView;
61-
if (
62-
activeView instanceof MarkdownView &&
63-
openedFile.path === path
64-
) {
65-
titleIcon.add(this.plugin, activeView.inlineTitleEl, iconName, {
66-
fontSize: calculateInlineTitleSize(),
67-
});
64+
if (this.plugin.getSettings().iconInTitleEnabled) {
65+
for (const openedFile of getAllOpenedFiles(this.plugin)) {
66+
const activeView = openedFile.leaf.view as InlineTitleView;
67+
if (
68+
activeView instanceof MarkdownView &&
69+
openedFile.path === path
70+
) {
71+
titleIcon.add(this.plugin, activeView.inlineTitleEl, iconName, {
72+
fontSize: calculateInlineTitleSize(),
73+
});
74+
}
6875
}
6976
}
7077
}

0 commit comments

Comments
 (0)