fix error when viewing some uncrawled instances

This commit is contained in:
Tao Bror Bojlén 2019-08-30 13:33:59 +01:00
parent d9b3024fae
commit fbc8e11722
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
3 changed files with 11 additions and 1 deletions

View file

@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed error when viewing some uncrawlable instances
### Security ### Security
## [2.8.0 - 2019-08-29] ## [2.8.0 - 2019-08-29]

View file

@ -54,6 +54,9 @@ defmodule BackendWeb.InstanceView do
instance.crawl_error != nil and instance.type == nil -> instance.crawl_error != nil and instance.type == nil ->
render_domain_and_error(instance) render_domain_and_error(instance)
crawl == nil ->
render_domain_and_error(instance)
true -> true ->
render_instance(instance, crawl, federation_restrictions) render_instance(instance, crawl, federation_restrictions)
end end

View file

@ -109,7 +109,12 @@ class InstanceScreenImpl extends React.PureComponent<IInstanceScreenProps, IInst
let content; let content;
if (this.props.isLoadingInstanceDetails || this.state.isProcessingNeighbors || this.state.isLoadingLocalGraph) { if (this.props.isLoadingInstanceDetails || this.state.isProcessingNeighbors || this.state.isLoadingLocalGraph) {
content = this.renderLoadingState(); content = this.renderLoadingState();
} else if (this.props.instanceLoadError || this.state.localGraphLoadError || !this.props.instanceDetails) { } else if (
this.props.instanceLoadError ||
this.state.localGraphLoadError ||
!this.props.instanceDetails ||
!this.props.instanceDetails.status
) {
content = <ErrorState />; content = <ErrorState />;
} else if (this.props.instanceDetails.status.toLowerCase().indexOf("personal instance") > -1) { } else if (this.props.instanceDetails.status.toLowerCase().indexOf("personal instance") > -1) {
content = this.renderPersonalInstanceErrorState(); content = this.renderPersonalInstanceErrorState();