addUICallback()
addUICallback(event: string, callback: function)
Overrides a UI (frontend) interaction using a callback function. The default action of the Samba's frontend will not execute, and instead your callback will override it.
In the below example user will be asked by a confirmation popup before leaving the session:
const leaveSessionCallback = () => {
console.log('Custom leave session logic called');
if (confirm('Are you sure you want to leave the session?')) {
sambaFrame.leaveSession();
}
};
sambaFrame.addUICallback('leaveSession', leaveSessionCallback);
Last updated