Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose_call_ui: Track XHRs for BBB and NextCloud Talk.

apoorvapendse85a597cae307
diff --git a/web/src/compose_call_ui.ts b/web/src/compose_call_ui.ts
index 90e2590fde2..4ef5742c6dd 100644
--- a/web/src/compose_call_ui.ts
+++ b/web/src/compose_call_ui.ts
@@ -130,10 +130,13 @@ export function generate_and_insert_audio_or_video_call_link(
meeting_name,
voice_only: is_audio_call,
};
- void channel.get({
+ xhr = channel.get({
url: "/json/calls/bigbluebutton/create",
data: request,
success(response) {
+ if (xhr && compose_call.ignored_call_xhrs.has(xhr)) {
+ return;
+ }
const data = call_response_schema.parse(response);
if (is_audio_call) {
insert_audio_call_url(data.url, $target_textarea);
@@ -174,14 +177,20 @@ export function generate_and_insert_audio_or_video_call_link(
const room_name = `${get_recipient_label()?.label_text ?? ""} conversation`;
const request = {room_name};
- channel.post({
+ xhr = channel.post({
url: "/json/calls/nextcloud_talk/create",
data: request,
success(response) {
+ if (xhr && compose_call.ignored_call_xhrs.has(xhr)) {
+ return;
+ }
const data = call_response_schema.parse(response);
insert_video_call_url(data.url, $target_textarea);
},
error(_, status) {
+ if (xhr && compose_call.ignored_call_xhrs.has(xhr)) {
+ return;
+ }
if (status !== "abort") {
ui_report.generic_embed_error(
$t_html({defaultMessage: "Failed to create video call."}),