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.

subscriber_api: Don't return unused channel request objects.

Varun Singh5891a9ef247f
diff --git a/web/src/subscriber_api.ts b/web/src/subscriber_api.ts
index eb7ebce354f..a2936f12018 100644
--- a/web/src/subscriber_api.ts
+++ b/web/src/subscriber_api.ts
@@ -14,20 +14,21 @@ export function add_user_ids_to_stream(
sub: StreamSubscription,
success: () => void,
failure: (xhr: JQuery.jqXHR<unknown>) => void,
-): JQuery.jqXHR<unknown> | undefined {
+): void {
// TODO: use stream_id when backend supports it
const stream_name = sub.name;
if (user_ids.length === 1 && people.is_my_user_id(Number(user_ids[0]))) {
// Self subscribe
const color = sub.color;
- return channel.post({
+ void channel.post({
url: "/json/users/me/subscriptions",
data: {subscriptions: JSON.stringify([{name: stream_name, color}])},
success,
error: failure,
});
+ return;
}
- return channel.post({
+ void channel.post({
url: "/json/users/me/subscriptions",
data: {
subscriptions: JSON.stringify([{name: stream_name}]),
@@ -43,10 +44,10 @@ export function remove_user_id_from_stream(
sub: StreamSubscription,
success: () => void,
failure: (xhr: JQuery.jqXHR<unknown>) => void,
-): JQuery.jqXHR<unknown> | undefined {
+): void {
// TODO: use stream_id when backend supports it
const stream_name = sub.name;
- return channel.del({
+ void channel.del({
url: "/json/users/me/subscriptions",
data: {subscriptions: JSON.stringify([stream_name]), principals: JSON.stringify([user_id])},
success,