File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
core/src/modals/modalContents/buttonBuilder
obsidian/src/settings/buttonTemplateSetting Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ export class ButtonBuilderModal extends ModalContent {
1616 component ?: ButtonBuilderModalComponent ;
1717 options : ButtonBuilderModalOptions ;
1818
19- config ?: ButtonConfig ;
20-
2119 constructor ( plugin : IPlugin , options : ButtonBuilderModalOptions ) {
2220 super ( ) ;
2321 this . plugin = plugin ;
@@ -36,7 +34,7 @@ export class ButtonBuilderModal extends ModalContent {
3634 props : {
3735 plugin : this . plugin ,
3836 modal : this ,
39- buttonConfig : this . config ?? this . plugin . api . buttonActionRunner . createDefaultButtonConfig ( ) ,
37+ buttonConfig : this . options . config ?? this . plugin . api . buttonActionRunner . createDefaultButtonConfig ( ) ,
4038 } ,
4139 } ) ;
4240 }
Original file line number Diff line number Diff line change 2020 }
2121
2222 function editTemplate(): void {
23- new ButtonBuilderModal ({
24- plugin: plugin ,
25- onOkay : _ => {
26- template = template ;
27- },
23+ plugin .internal .openButtonBuilderModal ({
2824 submitText: ' Submit' ,
29- config: template ,
30- }).open ();
25+ config: structuredClone (template ),
26+ onOkay : newTemplate => {
27+ template = newTemplate ;
28+ },
29+ });
3130 }
3231
3332 function copyTemplate(): void {
You can’t perform that action at this time.
0 commit comments