|
@@ -70,6 +70,16 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => isJoined.value,
|
|
|
+ () => {
|
|
|
+ if (!isJoined.value) {
|
|
|
+ handleLeave()
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
TRTC.checkSystemRequirements().then((checkResult) => {
|
|
|
console.log(checkResult.result, "checkResult.result");
|
|
|
if (!checkResult.result) {
|
|
@@ -205,16 +215,12 @@ async function handleUnpublish() {
|
|
|
}
|
|
|
|
|
|
async function handleLeave() {
|
|
|
- if (!isJoined.value) {
|
|
|
- return;
|
|
|
- }
|
|
|
if (isPublished.value) {
|
|
|
await handleUnpublish();
|
|
|
}
|
|
|
try {
|
|
|
uninstallEventHandlers();
|
|
|
await localClient.leave();
|
|
|
- store.commit("rtc/setIsJoined", false);
|
|
|
if (localStream) {
|
|
|
localStream.stop();
|
|
|
localStream.close();
|