@koi-design/callkit 1.0.24-beta.39 → 1.0.24-beta.40

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.d.ts CHANGED
@@ -353,6 +353,7 @@ declare class Connect {
353
353
  * Whether it's an active hangup
354
354
  */
355
355
  isUnprompted: boolean;
356
+ isCurrentSessionInvited: boolean;
356
357
  private reconnectConfig;
357
358
  /**
358
359
  * Whether registered
@@ -18664,7 +18664,7 @@ var WebCall = (() => {
18664
18664
  const getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
18665
18665
  if (!getUserMedia) {
18666
18666
  return Promise.reject(
18667
- new Error("Browser version is too low, please upgrade and try again.")
18667
+ new Error("Unable to obtain device permissions. Please check your browser settings or device permissions.")
18668
18668
  );
18669
18669
  }
18670
18670
  return new Promise((resolve, reject) => {
@@ -18694,6 +18694,7 @@ var WebCall = (() => {
18694
18694
  * Whether it's an active hangup
18695
18695
  */
18696
18696
  isUnprompted = false;
18697
+ isCurrentSessionInvited = false;
18697
18698
  reconnectConfig;
18698
18699
  /**
18699
18700
  * Whether registered
@@ -18746,7 +18747,7 @@ var WebCall = (() => {
18746
18747
  return audioRef;
18747
18748
  }
18748
18749
  async permission() {
18749
- this.callKit.logger.debug("permission");
18750
+ this.callKit.logger.debug("ssion");
18750
18751
  initUserMedia();
18751
18752
  const _stream = await navigator.mediaDevices.getUserMedia({ audio: true });
18752
18753
  closeStream(_stream);
@@ -18985,6 +18986,9 @@ var WebCall = (() => {
18985
18986
  onInvite: (invite) => {
18986
18987
  this.callKit.logger.debug("connect onInvite");
18987
18988
  this.currentSession = invite;
18989
+ if (this.isOutgoing) {
18990
+ this.isCurrentSessionInvited = false;
18991
+ }
18988
18992
  this.currentSession.stateChange.addListener((state) => {
18989
18993
  const isExecuting = this.isExecuting();
18990
18994
  switch (state) {
@@ -19024,7 +19028,9 @@ var WebCall = (() => {
19024
19028
  if (!this.isUnprompted) {
19025
19029
  this.callKit.callCenter.callEnd();
19026
19030
  } else if (this.isCalling()) {
19027
- this.currentSession.reject();
19031
+ if (this.isCurrentSessionInvited) {
19032
+ this.currentSession.reject();
19033
+ }
19028
19034
  this.callKit.callCenter.callEnd(true, false);
19029
19035
  }
19030
19036
  this.isUnprompted = false;
@@ -19075,6 +19081,7 @@ var WebCall = (() => {
19075
19081
  }
19076
19082
  this.callKit.trigger(KitEvent.KIT_INVITE, {
19077
19083
  accept: () => {
19084
+ this.isCurrentSessionInvited = true;
19078
19085
  this.callKit.trigger(KitEvent.CALL_CONNECTING, /* @__PURE__ */ new Date());
19079
19086
  this.currentSession.accept(options);
19080
19087
  },