Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
decaplanet committed Jan 15, 2024
1 parent e6a7ecb commit bbdf887
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/etc/icons/icon.ts
Expand Up @@ -3,11 +3,11 @@ import { addIcon } from "obsidian";
import formattoLogo from "./img/formatto-logo.svg";

export class CustomIcon {
private icons = [{ name: "formatto-logo", svg: formattoLogo }];
private icons = [{ iconId: "formatto-logo", svg: formattoLogo }];

registerIcons = () => {
this.icons.forEach(({ name: id, svg }) => {
addIcon(id, svg);
this.icons.forEach(({ iconId, svg }) => {
addIcon(iconId, svg);
});
};
}
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -23,13 +23,13 @@ export class FormattoUtil {
} catch (error) {
new Notice(error);
}

if (!formattedDocument) return;

if (formattedDocument !== originalDocument) {
editor.setValue(formattedDocument);
editor.setSelection(cursorPosition, cursorPosition);
}

if (
this.plugin.settings.otherOptions.notifyWhenUnchanged &&
formattedDocument === originalDocument
Expand Down

0 comments on commit bbdf887

Please sign in to comment.