Skip to content

Commit

Permalink
fix: Fixes issue where a type couldn't be renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Mar 29, 2022
1 parent f56ebb8 commit f8d37ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,6 @@ export default class AdmonitionSetting extends PluginSettingTab {
modalAdmonition.type != admonition.type
) {
this.plugin.unregisterType(admonition);
this.plugin.registerType(
modalAdmonition.type
);

const existing: [string, Admonition][] =
Object.entries(
Expand All @@ -832,6 +829,10 @@ export default class AdmonitionSetting extends PluginSettingTab {
] = modalAdmonition;
}

this.plugin.registerType(
modalAdmonition.type
);

this.plugin.calloutManager.addAdmonition(
modalAdmonition
);
Expand Down

0 comments on commit f8d37ac

Please sign in to comment.