From f7ae7c241940727a1a7b51e4deb1abc7c5773bb6 Mon Sep 17 00:00:00 2001 From: acondal Date: Tue, 26 Mar 2024 12:08:30 +0100 Subject: [PATCH] feat: fix selectResultvariant is not a function EMP-3750 --- .../src/components/result/result-variant-selector.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/x-components/src/components/result/result-variant-selector.vue b/packages/x-components/src/components/result/result-variant-selector.vue index 42e14c61d1..7adb8c8d2c 100644 --- a/packages/x-components/src/components/result/result-variant-selector.vue +++ b/packages/x-components/src/components/result/result-variant-selector.vue @@ -84,9 +84,11 @@ * Callback to be called when a variant is selected. * * @public + * @returns The 'selectResultVariant' injection key. */ - const selectResultVariant: ((variant: ResultVariant, level?: number) => void) | undefined = - useHybridInject(SELECT_RESULT_VARIANT_KEY as string); + const selectResultVariant: + | ((variant: ResultVariant, level?: number) => void) + | undefined = () => useHybridInject(SELECT_RESULT_VARIANT_KEY as string); /** * The original result, used to retrieve the available variants for the level. @@ -134,7 +136,7 @@ * @internal */ const selectVariant = (variant: ResultVariant): void => { - selectResultVariant!(variant, props.level); + selectResultVariant(variant, props.level); }; /**