How to fire callback when Desktop sharing is turned of by chrome dialog

How to fire callback when Desktop sharing is turned of by chrome dialog?

  JitsiMeetJS.createLocalTracks({ devices: ['desktop'] })
            .then((tracks) => {
            })
            .catch(() => {
                console.log("User Cancel");
            })