UX: do not show error title
This commit is contained in:
parent
201617811e
commit
794b9a5c24
|
@ -767,14 +767,12 @@ const PostStream = RestModel.extend({
|
||||||
|
|
||||||
// If the result was 404 the post is not found
|
// If the result was 404 the post is not found
|
||||||
if (status === 404) {
|
if (status === 404) {
|
||||||
topic.set('errorTitle', I18n.t('topic.not_found.title'));
|
|
||||||
topic.set('notFoundHtml', result.jqXHR.responseText);
|
topic.set('notFoundHtml', result.jqXHR.responseText);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the result is 403 it means invalid access
|
// If the result is 403 it means invalid access
|
||||||
if (status === 403) {
|
if (status === 403) {
|
||||||
topic.set('errorTitle', I18n.t('topic.invalid_access.title'));
|
|
||||||
topic.set('noRetry', true);
|
topic.set('noRetry', true);
|
||||||
if (Discourse.User.current()) {
|
if (Discourse.User.current()) {
|
||||||
topic.set('message', I18n.t('topic.invalid_access.description'));
|
topic.set('message', I18n.t('topic.invalid_access.description'));
|
||||||
|
@ -785,7 +783,6 @@ const PostStream = RestModel.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise supply a generic error message
|
// Otherwise supply a generic error message
|
||||||
topic.set('errorTitle', I18n.t('topic.server_error.title'));
|
|
||||||
topic.set('message', I18n.t('topic.server_error.description'));
|
topic.set('message', I18n.t('topic.server_error.description'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import RestModel from 'discourse/models/rest';
|
||||||
|
|
||||||
const Topic = RestModel.extend({
|
const Topic = RestModel.extend({
|
||||||
message: null,
|
message: null,
|
||||||
errorTitle: null,
|
|
||||||
errorLoading: false,
|
errorLoading: false,
|
||||||
|
|
||||||
fancyTitle: function() {
|
fancyTitle: function() {
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
{{#if topic.details.loaded}}
|
{{#if topic.details.loaded}}
|
||||||
{{topic-status topic=topic}}
|
{{topic-status topic=topic}}
|
||||||
<a class='topic-link' href='{{unbound topic.url}}' {{action "jumpToTopPost"}}>{{{topic.fancyTitle}}}</a>
|
<a class='topic-link' href='{{unbound topic.url}}' {{action "jumpToTopPost"}}>{{{topic.fancyTitle}}}</a>
|
||||||
{{else}}
|
|
||||||
{{#if topic.errorLoading}}
|
|
||||||
<span class="error">{{topic.errorTitle}}</span>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h1>
|
</h1>
|
||||||
{{#if topic.details.loaded}}
|
{{#if topic.details.loaded}}
|
||||||
|
|
Loading…
Reference in New Issue