From 09b7e1f737659d0ee75e5ac2fd5c1decf8fa15a6 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Tue, 4 Aug 2020 02:31:59 +0800
Subject: ...

---
 Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx')

diff --git a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
index dc5bfda8..42171e13 100644
--- a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
+++ b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
@@ -12,7 +12,7 @@ import { getAlertHost } from '../common/alert-service';
 import { useEventEmiiter, UiLogicError } from '../common';
 import {
   TimelineInfo,
-  TimelinePostListState,
+  TimelinePostsWithSyncState,
   timelineService,
 } from '../data/timeline';
 import { userService } from '../data/user';
@@ -24,8 +24,10 @@ import Timeline, {
 import AppBar from '../common/AppBar';
 import TimelinePostEdit, { TimelinePostSendCallback } from './TimelinePostEdit';
 
+type TimelinePostSyncState = 'syncing' | 'synced' | 'offline';
+
 const TimelinePostSyncStateBadge: React.FC<{
-  state: 'syncing' | 'synced' | 'offline';
+  state: TimelinePostSyncState;
   style?: CSSProperties;
   className?: string;
 }> = ({ state, style, className }) => {
@@ -84,7 +86,7 @@ export interface TimelineCardComponentProps<TManageItems> {
 export interface TimelinePageTemplateUIProps<TManageItems> {
   avatarKey?: string | number;
   timeline?: TimelineInfo;
-  postListState?: TimelinePostListState;
+  postListState?: TimelinePostsWithSyncState;
   CardComponent: React.ComponentType<TimelineCardComponentProps<TManageItems>>;
   onMember: () => void;
   onManage?: (item: TManageItems | 'property') => void;
@@ -197,7 +199,7 @@ export default function TimelinePageTemplateUI<TManageItems>(
   } else {
     if (timeline != null) {
       let timelineBody: React.ReactElement;
-      if (postListState != null && postListState.state !== 'loading') {
+      if (postListState != null) {
         if (postListState.state === 'forbid') {
           timelineBody = (
             <p className="text-danger">{t('timeline.messageCantSee')}</p>
-- 
cgit v1.2.3

