From efe384502d54a5902d3d20648c1b3fc8c14cde44 Mon Sep 17 00:00:00 2001 From: Seyed Mohammad Mahdi Hatami Date: Wed, 28 Jun 2023 23:50:00 +0330 Subject: [PATCH] made callback invoking async to await for result Signed-off-by: Seyed Mohammad Mahdi Hatami --- src/plugins/plugin.tooltip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/plugin.tooltip.js b/src/plugins/plugin.tooltip.js index 2e881417f78..3fad29a2913 100644 --- a/src/plugins/plugin.tooltip.js +++ b/src/plugins/plugin.tooltip.js @@ -435,10 +435,10 @@ const defaultCallbacks = { * @param {keyof typeof defaultCallbacks} name * @param {*} ctx * @param {*} arg - * @returns {any} + * @returns {Promise} */ -function invokeCallbackWithFallback(callbacks, name, ctx, arg) { - const result = callbacks[name].call(ctx, arg); +async function invokeCallbackWithFallback(callbacks, name, ctx, arg) { + const result = await callbacks[name].call(ctx, arg); if (typeof result === 'undefined') { return defaultCallbacks[name].call(ctx, arg);