From 0897ce6c20202b5bde571f2aa0d29a597861bda0 Mon Sep 17 00:00:00 2001 From: Nischay Date: Sun, 21 Apr 2024 19:44:54 +0530 Subject: [PATCH] Buggy code, no idea why toWidget gets no response --- web/index.html | 2 +- web/src/index.js | 1 + web/src/widget-api.js | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index c01b14d..41e2633 100644 --- a/web/index.html +++ b/web/index.html @@ -5,7 +5,7 @@ Maunium sticker picker - + diff --git a/web/src/index.js b/web/src/index.js index e2842a0..be7b3df 100644 --- a/web/src/index.js +++ b/web/src/index.js @@ -40,6 +40,7 @@ const isMobileSafari = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && naviga const supportedThemes = ["light", "dark", "black"] + const defaultState = { packs: [], filtering: { diff --git a/web/src/widget-api.js b/web/src/widget-api.js index 3ea51e4..7e361e4 100644 --- a/web/src/widget-api.js +++ b/web/src/widget-api.js @@ -17,10 +17,18 @@ const widgetId = null; // if you know the widget ID, supply it. const api = new mxwidgets.WidgetApi(widgetId); + // Before doing anything else, request capabilities: api.requestCapabilities(mxwidgets.StickerpickerCapabilities); api.requestCapability(mxwidgets.MatrixCapabilities.MSC4039UploadFile); + +// Start the messaging +api.start(); + +// If waitForIframeLoad is false, tell the client that we're good to go +api.sendContentLoaded(); + export function sendSticker(content){ api.sendSticker(content); }