fix: remove redundant guard and export VueWidgets type

- Remove nested if check in getCustomVueWidgets registration by
  capturing method reference before async IIFE
- Export VueWidgets type for use by external extension code
This commit is contained in:
Johnpaul
2026-01-13 20:46:47 +01:00
parent a9503c5a2f
commit 73b9079538
2 changed files with 4 additions and 5 deletions

View File

@@ -82,11 +82,10 @@ export const useExtensionService = () => {
}
if (extension.getCustomVueWidgets) {
const getVueWidgets = extension.getCustomVueWidgets
void (async () => {
if (extension.getCustomVueWidgets) {
const vueWidgets = await extension.getCustomVueWidgets(app)
registerVueWidgets(vueWidgets)
}
const vueWidgets = await getVueWidgets(app)
registerVueWidgets(vueWidgets)
})()
}

View File

@@ -31,7 +31,7 @@ export interface VueWidgetDefinition {
aliases?: string[]
}
type VueWidgets = Record<string, VueWidgetDefinition>
export type VueWidgets = Record<string, VueWidgetDefinition>
export interface AboutPageBadge {
label: string