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.

user_profile_modal: Show error message if fetch fails.

Evy Kassirer33bbffb70a1f
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index b5b447309af..ede68145f87 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -355,6 +355,12 @@ async function render_or_update_user_streams_tab(user: User): Promise<void> {
}
loading.destroy_indicator($(".stream-list-loader"));
+ if (!peer_data.subscriber_data_loaded_for_user(user.user_id)) {
+ $(".stream-list-container .error-message").html(
+ $t_html({defaultMessage: "Failed to load subscribed channels."}),
+ );
+ return;
+ }
if (!user_streams_list_widget) {
render_user_stream_list(user_streams, user);
diff --git a/web/styles/popovers.css b/web/styles/popovers.css
index fd0b291e3a7..c75194b4d50 100644
--- a/web/styles/popovers.css
+++ b/web/styles/popovers.css
@@ -575,6 +575,12 @@ ul.popover-group-menu-member-list {
}
}
+ .error-message:not(:empty) {
+ color: var(--color-alert-error-red);
+ text-align: center;
+ margin-top: 20px;
+ }
+
.stream-list-bottom-section,
.group-list-bottom-section {
grid-area: bottom;
diff --git a/web/templates/user_profile_modal.hbs b/web/templates/user_profile_modal.hbs
index 69fc71cb53e..8a1c0fc9287 100644
--- a/web/templates/user_profile_modal.hbs
+++ b/web/templates/user_profile_modal.hbs
@@ -123,6 +123,7 @@
</button>
</div>
<div class="stream-list-loader"></div>
+ <div class="error-message"></div>
<div class="subscription-stream-list" data-simplebar data-simplebar-tab-index="-1">
<ul class="user-stream-list" data-empty="{{t 'No channel subscriptions.' }}" data-search-results-empty="{{t 'No matching channels.' }}"></ul>
</div>