From 40d7ad8fa1686bcc78d3c0224beeec0ac9fd31b6 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 9 Aug 2020 22:35:27 +0800 Subject: Refactor timeline observable. --- .../ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Timeline/ClientApp/src/app/timeline') diff --git a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx index 70507988..18b3323d 100644 --- a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx +++ b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx @@ -24,7 +24,7 @@ import Timeline, { import AppBar from '../common/AppBar'; import TimelinePostEdit, { TimelinePostSendCallback } from './TimelinePostEdit'; -type TimelinePostSyncState = 'cache' | 'syncing' | 'synced' | 'offline'; +type TimelinePostSyncState = 'syncing' | 'synced' | 'offline'; const TimelinePostSyncStateBadge: React.FC<{ state: TimelinePostSyncState; @@ -37,7 +37,6 @@ const TimelinePostSyncStateBadge: React.FC<{
{(() => { switch (state) { - case 'cache': case 'syncing': { return ( <> @@ -226,11 +225,17 @@ export default function TimelinePageTemplateUI( ? 'calc(68px + 1.5em)' : `${cardHeight + 60}px`; + const syncState: TimelinePostSyncState = postListState.syncing + ? 'syncing' + : postListState.type === 'synced' + ? 'synced' + : 'offline'; + timelineBody = (