js/stream_edit.js: Remove function to update stream on subs add/remove.

Remove the functions call for updating stream settings UI in
frontend, cause we are already handling this in the subscription
add and remove event we get after successful operation.
This commit is contained in:
YJDave
2018-03-14 07:59:33 +05:30
committed by Tim Abbott
parent 6ffe2cc815
commit e8f6b9e575

View File

@@ -496,13 +496,7 @@ $(function () {
if (data.subscribed.hasOwnProperty(principal)) { if (data.subscribed.hasOwnProperty(principal)) {
stream_subscription_info_elem.text(i18n.t("Subscribed successfully!")); stream_subscription_info_elem.text(i18n.t("Subscribed successfully!"));
if (people.is_current_user(principal)) { // The rest of the work is done via the subscription -> add event we will get
// mark_subscribed adds the user to the member list
// TODO: We should really let the event system
// handle this, as mark_subscribed has
// lots of side effects.
stream_events.mark_subscribed(sub);
}
} else { } else {
stream_subscription_info_elem.text(i18n.t("User already subscribed.")); stream_subscription_info_elem.text(i18n.t("User already subscribed."));
} }
@@ -538,15 +532,7 @@ $(function () {
// Remove the user from the subscriber list. // Remove the user from the subscriber list.
list_entry.remove(); list_entry.remove();
stream_subscription_info_elem.text(i18n.t("Unsubscribed successfully!")); stream_subscription_info_elem.text(i18n.t("Unsubscribed successfully!"));
// The rest of the work is done via the subscription -> remove event we will get
if (people.is_current_user(principal)) {
// If you're unsubscribing yourself, mark whole
// stream entry as you being unsubscribed.
// TODO: We should really let the event system
// handle this, as mark_unsubscribed has
// lots of side effects.
stream_events.mark_unsubscribed(sub);
}
} else { } else {
stream_subscription_info_elem.text(i18n.t("User is already not subscribed.")); stream_subscription_info_elem.text(i18n.t("User is already not subscribed."));
} }