jssz-meeting-component 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -31690,7 +31690,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
31690
31690
  };
31691
31691
  }
31692
31692
  });
31693
- const IncomingCallModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-055bf8e4"]]);
31693
+ const IncomingCallModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0fc5fece"]]);
31694
31694
  const _hoisted_1$1 = {
31695
31695
  key: 0,
31696
31696
  class: "incoming-call-panel"
@@ -31707,6 +31707,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
31707
31707
  const props = __props;
31708
31708
  const userId2 = getUserId();
31709
31709
  const incomingCallList = computed(() => incomingCallQueue.value);
31710
+ const ensureRequestSuccess = (resp, fallbackMessage) => {
31711
+ if ((resp == null ? void 0 : resp.code) !== 200) {
31712
+ throw new Error((resp == null ? void 0 : resp.message) || fallbackMessage);
31713
+ }
31714
+ return resp;
31715
+ };
31716
+ const createLeaveRequestError = (message, err) => ({
31717
+ message,
31718
+ keepIncomingCallModal: true,
31719
+ cause: err
31720
+ });
31710
31721
  const handleAcceptIncomingCall = (callerInfo) => {
31711
31722
  const currentMeetingInfo = JSON.parse(
31712
31723
  sessionStorage.getItem("JS_MEETING_INFO") || "{}"
@@ -31718,11 +31729,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
31718
31729
  leavePromise = getMeetingLeave({
31719
31730
  meetingId: currentMeetingInfo.meetingId,
31720
31731
  memberId: userId2
31732
+ }).then((res) => ensureRequestSuccess(res, "退出当前会议失败")).catch((err) => {
31733
+ const message = (err == null ? void 0 : err.message) || "退出当前会议失败";
31734
+ showNotification(message, "error", 5e3);
31735
+ throw createLeaveRequestError(message, err);
31721
31736
  });
31722
31737
  } else if (isInCall) {
31723
31738
  leavePromise = getHangUpCall({
31724
31739
  meetingId: currentMeetingInfo.meetingId,
31725
31740
  memberId: userId2
31741
+ }).then((res) => ensureRequestSuccess(res, "挂断当前通话失败")).catch((err) => {
31742
+ const message = (err == null ? void 0 : err.message) || "挂断当前通话失败";
31743
+ showNotification(message, "error", 5e3);
31744
+ throw createLeaveRequestError(message, err);
31726
31745
  });
31727
31746
  } else {
31728
31747
  leavePromise = Promise.resolve();
@@ -31759,7 +31778,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
31759
31778
  }
31760
31779
  }).catch((err) => {
31761
31780
  console.error("接听新来电失败", err);
31762
- closeIncomingCall(callerInfo.meetingId);
31781
+ if (!(err == null ? void 0 : err.keepIncomingCallModal)) {
31782
+ closeIncomingCall(callerInfo.meetingId);
31783
+ }
31763
31784
  });
31764
31785
  };
31765
31786
  const handleRejectIncomingCall = (callerInfo) => {
@@ -31775,29 +31796,27 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
31775
31796
  });
31776
31797
  };
31777
31798
  return (_ctx, _cache) => {
31778
- return openBlock(), createBlock(Teleport, { to: "body" }, [
31779
- unref(incomingCallVisible) && incomingCallList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
31780
- createElementVNode("div", _hoisted_2$1, [
31781
- _cache[0] || (_cache[0] = createElementVNode("span", null, "新来电", -1)),
31782
- createElementVNode("span", _hoisted_3$1, toDisplayString(incomingCallList.value.length), 1)
31783
- ]),
31784
- createElementVNode("div", _hoisted_4$1, [
31785
- (openBlock(true), createElementBlock(Fragment, null, renderList(incomingCallList.value, (item) => {
31786
- return openBlock(), createBlock(IncomingCallModal, {
31787
- key: item.meetingId,
31788
- "caller-info": item,
31789
- theme: props.theme,
31790
- onAccept: handleAcceptIncomingCall,
31791
- onReject: handleRejectIncomingCall
31792
- }, null, 8, ["caller-info", "theme"]);
31793
- }), 128))
31794
- ])
31795
- ])) : createCommentVNode("", true)
31796
- ]);
31799
+ return unref(incomingCallVisible) && incomingCallList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
31800
+ createElementVNode("div", _hoisted_2$1, [
31801
+ _cache[0] || (_cache[0] = createElementVNode("span", null, "新来电", -1)),
31802
+ createElementVNode("span", _hoisted_3$1, toDisplayString(incomingCallList.value.length), 1)
31803
+ ]),
31804
+ createElementVNode("div", _hoisted_4$1, [
31805
+ (openBlock(true), createElementBlock(Fragment, null, renderList(incomingCallList.value, (item) => {
31806
+ return openBlock(), createBlock(IncomingCallModal, {
31807
+ key: item.meetingId,
31808
+ "caller-info": item,
31809
+ theme: props.theme,
31810
+ onAccept: handleAcceptIncomingCall,
31811
+ onReject: handleRejectIncomingCall
31812
+ }, null, 8, ["caller-info", "theme"]);
31813
+ }), 128))
31814
+ ])
31815
+ ])) : createCommentVNode("", true);
31797
31816
  };
31798
31817
  }
31799
31818
  });
31800
- const GlobalIncomingCallModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b9a920d0"]]);
31819
+ const GlobalIncomingCallModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-70a8fc14"]]);
31801
31820
  const _hoisted_1 = {
31802
31821
  key: 0,
31803
31822
  class: "unattended-display"