1
1
import "@/ui/styles/styles.scss" ;
2
2
3
- import { MarkdownView , Notice , Plugin } from "obsidian" ;
3
+ import { MarkdownView , Plugin } from "obsidian" ;
4
4
5
5
import registerCustomIcons from "@/assets/icons" ;
6
6
import { EnhancedEditor } from "@/data/models/Settings" ;
@@ -21,21 +21,17 @@ export default class SlashCommanderPlugin extends Plugin {
21
21
}
22
22
23
23
public async onload ( ) : Promise < void > {
24
- try {
25
- // Initialize the Zustand state store
26
- useSettingStore . getState ( ) . setPlugin ( this ) ;
27
- await useSettingStore . getState ( ) . initialize ( ) ;
24
+ // Initialize the Zustand state store
25
+ useSettingStore . getState ( ) . setPlugin ( this ) ;
26
+ await useSettingStore . getState ( ) . initialize ( ) ;
28
27
29
- registerCustomIcons ( ) ;
28
+ registerCustomIcons ( ) ;
30
29
31
- // Register settings tab
32
- this . addSettingTab ( new CommanderSettingTab ( this ) ) ;
30
+ // Register settings tab
31
+ this . addSettingTab ( new CommanderSettingTab ( this ) ) ;
33
32
34
- // Initialize plugin UI and commands
35
- this . initializePlugin ( ) ;
36
- } catch ( error ) {
37
- new Notice ( `SlashCommander: ${ error } ` ) ;
38
- }
33
+ // Initialize plugin UI and commands
34
+ this . initializePlugin ( ) ;
39
35
}
40
36
41
37
private initializePlugin ( ) : void {
@@ -70,14 +66,10 @@ export default class SlashCommanderPlugin extends Plugin {
70
66
}
71
67
72
68
public onunload ( ) : void {
73
- try {
74
- document . head . querySelector ( "style#cmdr" ) ?. remove ( ) ;
75
- this . menuSuggest ?. close ( ) ;
69
+ document . head . querySelector ( "style#cmdr" ) ?. remove ( ) ;
70
+ this . menuSuggest ?. close ( ) ;
76
71
77
- // Clean up Zustand store subscription
78
- this . storeUnsubscribe ?.( ) ;
79
- } catch ( error ) {
80
- new Notice ( `SlashCommander: ${ error } ` ) ;
81
- }
72
+ // Clean up Zustand store subscription
73
+ this . storeUnsubscribe ?.( ) ;
82
74
}
83
75
}
0 commit comments