async leaveRoom()

in web-ui/src/components/chime/ChimeSdkWrapper.js [305:334]


  async leaveRoom(end) {
    try {
      this.audioVideo.stop();
    } catch (error) {
      this.logError(error);
    }

    // try {
    //   await this.messagingSocket.close(this.WEB_SOCKET_TIMEOUT_MS);
    // } catch (error) {
    //   this.logError(error);
    // }

    try {
      if (end && this.title) {
        await fetch(
          `${config.CHIME_ROOM_API}/end?title=${encodeURIComponent(
            this.title,
          )}`,
          {
            method: 'POST',
          },
        );
      }
    } catch (error) {
      this.logError(error);
    }

    this.initializeSdkWrapper();
  }