mirror of
https://github.com/maunium/stickerpicker.git
synced 2025-08-28 02:41:48 +02:00
Buggy code, no idea why toWidget gets no response
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
|
||||
<title>Maunium sticker picker</title>
|
||||
<script src="https://unpkg.com/matrix-widget-api@1.6.0/dist/api.js"></script>
|
||||
<link rel="modulepreload" href="src/widget-api.js"/>
|
||||
<script type="module" src="src/widget-api.js"></script>
|
||||
<link rel="modulepreload" href="src/frequently-used.js"/>
|
||||
<link rel="modulepreload" href="src/spinner.js"/>
|
||||
<link rel="modulepreload" href="lib/htm/preact.js"/>
|
||||
|
@@ -40,6 +40,7 @@ const isMobileSafari = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && naviga
|
||||
|
||||
const supportedThemes = ["light", "dark", "black"]
|
||||
|
||||
|
||||
const defaultState = {
|
||||
packs: [],
|
||||
filtering: {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user