Skip to content

Commit

Permalink
fix(fix-mobile-icon): on mobile, custom rules doesn't load at startup (
Browse files Browse the repository at this point in the history
…#624)

close #617

Co-authored-by: Lisandra Simonetti <l.simonetti@stragen.fr>
  • Loading branch information
Mara-Li and Lisandra Simonetti authored Dec 4, 2024
1 parent 7e85b17 commit d255b5b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/custom-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const getFileItems = async (
): Promise<FileItem[]> => {
const result: FileItem[] = [];
for (const fileExplorer of plugin.getRegisteredFileExplorers()) {
const files = Object.values(fileExplorer.fileItems);
const files = Object.values(fileExplorer.fileItems || {});
for (const fileItem of files) {
if (await isApplicable(plugin, rule, fileItem.file.path)) {
result.push(fileItem);
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ui/customIconRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default class CustomIconRuleSetting extends IconFolderSetting {

const addedPaths: string[] = [];
for (const fileExplorer of this.plugin.getRegisteredFileExplorers()) {
const files = Object.values(fileExplorer.fileItems);
const files = Object.values(fileExplorer.fileItems || {});
for (const rule of customRule.getSortedRules(this.plugin)) {
// Removes the icon tabs from all opened files.
this.updateIconTabs(rule, true, addedPaths);
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ui/emojiStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class EmojiStyleSetting extends IconFolderSetting {

private updateDOM(): void {
for (const fileExplorer of this.plugin.getRegisteredFileExplorers()) {
const fileItems = Object.entries(fileExplorer.fileItems);
const fileItems = Object.entries(fileExplorer.fileItems || {});
for (const [path, _] of fileItems) {
let iconName = this.plugin.getData()[path] as string | undefined | null;
if (!iconName) {
Expand Down

0 comments on commit d255b5b

Please sign in to comment.