Fix flickering caused by turbolinks and other minor fixes

This commit is contained in:
riggraz
2019-09-11 21:03:40 +02:00
parent 8d9ab0f717
commit 5ca113b545
3 changed files with 8 additions and 4 deletions

View File

@@ -50,7 +50,10 @@ const PostList = ({
/> />
)) ))
: :
!areLoading ? <span className="infoText text-muted">There are no posts.</span> : null areLoading ?
<span className="infoText">Loading...</span>
:
<span className="infoText text-muted">There are no posts.</span>
} }
</InfiniteScroll> </InfiniteScroll>
</div> </div>

View File

@@ -24,9 +24,6 @@ const PostStatusFilter = ({
}: Props) => ( }: Props) => (
<div className="box sidebar-box postStatusFilterContainer"> <div className="box sidebar-box postStatusFilterContainer">
<span className="smallTitle">Filter by post status:</span> <span className="smallTitle">Filter by post status:</span>
{ areLoading ? <Spinner /> : null }
{ error ? <span className="error">{error}</span> : null }
{ {
postStatuses.map((postStatus, i) => ( postStatuses.map((postStatus, i) => (
<PostStatusListItem <PostStatusListItem
@@ -41,6 +38,8 @@ const PostStatusFilter = ({
/> />
)) ))
} }
{ areLoading ? <Spinner /> : null }
{ error ? <span className="error">{error}</span> : null }
</div> </div>
); );

View File

@@ -5,6 +5,8 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= csp_meta_tag %> <%= csp_meta_tag %>
<meta name="turbolinks-cache-control" content="no-cache">
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head> </head>