Skip to content

Commit d255b5b

Browse files
Mara-LiLisandra Simonetti
andauthored
fix(fix-mobile-icon): on mobile, custom rules doesn't load at startup (#624)
close #617 Co-authored-by: Lisandra Simonetti <[email protected]>
1 parent 7e85b17 commit d255b5b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/lib/custom-rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const getFileItems = async (
190190
): Promise<FileItem[]> => {
191191
const result: FileItem[] = [];
192192
for (const fileExplorer of plugin.getRegisteredFileExplorers()) {
193-
const files = Object.values(fileExplorer.fileItems);
193+
const files = Object.values(fileExplorer.fileItems || {});
194194
for (const fileItem of files) {
195195
if (await isApplicable(plugin, rule, fileItem.file.path)) {
196196
result.push(fileItem);

src/settings/ui/customIconRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export default class CustomIconRuleSetting extends IconFolderSetting {
180180

181181
const addedPaths: string[] = [];
182182
for (const fileExplorer of this.plugin.getRegisteredFileExplorers()) {
183-
const files = Object.values(fileExplorer.fileItems);
183+
const files = Object.values(fileExplorer.fileItems || {});
184184
for (const rule of customRule.getSortedRules(this.plugin)) {
185185
// Removes the icon tabs from all opened files.
186186
this.updateIconTabs(rule, true, addedPaths);

src/settings/ui/emojiStyle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class EmojiStyleSetting extends IconFolderSetting {
2929

3030
private updateDOM(): void {
3131
for (const fileExplorer of this.plugin.getRegisteredFileExplorers()) {
32-
const fileItems = Object.entries(fileExplorer.fileItems);
32+
const fileItems = Object.entries(fileExplorer.fileItems || {});
3333
for (const [path, _] of fileItems) {
3434
let iconName = this.plugin.getData()[path] as string | undefined | null;
3535
if (!iconName) {

0 commit comments

Comments
 (0)