Skip to content

Commit

Permalink
Add refresh command (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriTheElk authored Dec 12, 2024
1 parent 9c4e263 commit e9ef9eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "emera",
"name": "Emera",
"version": "1.4.1",
"version": "1.4.2",
"minAppVersion": "1.6.5",
"description": "Enables you to use custom React components and inline JavaScript, kinda like MDX.",
"author": "OlegWock",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-emera",
"version": "1.4.1",
"version": "1.4.2",
"description": "MDX for Obsidian. Kinda.",
"main": "main.js",
"scripts": {
Expand Down
11 changes: 10 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, MarkdownView, Plugin, PluginManifest } from 'obsidian';
import { App, MarkdownView, Notice, Plugin, PluginManifest } from 'obsidian';
import { SettingTab } from './settings';
import { loadUserModule } from './bundler';
import { EMERA_ROOT_SCOPE } from './consts';
Expand Down Expand Up @@ -64,6 +64,15 @@ export class EmeraPlugin extends Plugin {
this.resolveComponentsLoaded();
this.refreshEditors();
});

this.addCommand({
id: 'refresh',
name: 'Refresh user module',
callback: async () => {
await this.refreshUserModule();
new Notice('User module was reloaded.');
},
});
}

refreshEditors = () => {
Expand Down

0 comments on commit e9ef9eb

Please sign in to comment.