Skip to content

Commit 8cbfc32

Browse files
committed
fix #276
1 parent 8718a22 commit 8cbfc32

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

packages/core/src/modals/modalContents/buttonBuilder/ButtonBuilderModal.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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
}

packages/obsidian/src/settings/buttonTemplateSetting/ButtonTemplateSettingComponent.svelte

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
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 {

0 commit comments

Comments
 (0)