message_feed_errors: Don't show search public stream to spectators.

Fixes #20299.
This commit is contained in:
Aman Agrawal 2022-01-19 10:10:21 +00:00 committed by Tim Abbott
parent c528e768ff
commit b4075b78eb
2 changed files with 13 additions and 4 deletions

View File

@ -82,6 +82,7 @@ export function show_end_of_results_notice() {
$(".all-messages-search-caution").show(); $(".all-messages-search-caution").show();
// Set the link to point to this search with streams:public added. // Set the link to point to this search with streams:public added.
// Note that element we adjust is not visible to spectators.
const operators = narrow_state.filter().operators(); const operators = narrow_state.filter().operators();
const update_hash = hash_util.search_public_streams_notice_url(operators); const update_hash = hash_util.search_public_streams_notice_url(operators);
$(".all-messages-search-caution a.search-shared-history").attr("href", update_hash); $(".all-messages-search-caution a.search-shared-history").attr("href", update_hash);

View File

@ -19,10 +19,18 @@
target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}} target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
{{/tr}} {{/tr}}
&nbsp; &nbsp;
{{#tr}} <span class="only-visible-for-spectators">
Consider <z-link>searching all public streams</z-link>. {{#tr}}
{{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}} <z-link>Log in</z-link> to search your personal history.
{{/tr}} {{#*inline "z-link"}}<a href="/login/">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
</span>
<span class="hidden-for-spectators">
{{#tr}}
Consider <z-link>searching all public streams</z-link>.
{{#*inline "z-link"}}<a class="search-shared-history" href="">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
</span>
</p> </p>
</div> </div>
<div class="empty_feed_notice_main"></div> <div class="empty_feed_notice_main"></div>