Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created March 17, 2023 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/6b6c2333fd47f12f13abfe5abb828c0f to your computer and use it in GitHub Desktop.
Save sendbird-community/6b6c2333fd47f12f13abfe5abb828c0f to your computer and use it in GitHub Desktop.
Pass data to modal
const openModal = async () => {
client = await app.initialized();
const dataToPassToModal = await collectDataToPassToModal()
console.log(dataToPassToModal)
//Open calls modal and send data to the modal.
client.interface.trigger("showModal", {
title: "Sendbird fallback service",
template: "./modal.html",
data: dataToPassToModal
}).then(async function(data) {
console.log(data)
//Data was sent to the modal.
}).catch(function(error) {
console.log(error)
throw Error(error)
// error - error object
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment