From 0d4e3079aa53f9553eb538951b6ebd6bf4a7a2ee Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 7 Aug 2020 18:27:04 +0800 Subject: Create home page for offline. --- Timeline/ClientApp/src/app/data/timeline.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Timeline/ClientApp/src/app/data/timeline.ts') diff --git a/Timeline/ClientApp/src/app/data/timeline.ts b/Timeline/ClientApp/src/app/data/timeline.ts index c0d2141f..9fc99d59 100644 --- a/Timeline/ClientApp/src/app/data/timeline.ts +++ b/Timeline/ClientApp/src/app/data/timeline.ts @@ -881,3 +881,13 @@ export function usePostList( }, [timelineName]); return state; } + +export async function getAllCachedTimelineNames(): Promise { + const keys = await dataStorage.keys(); + return keys + .filter( + (key) => + key.startsWith('timeline.') && (key.match(/\./g) ?? []).length === 1 + ) + .map((key) => key.substr('timeline.'.length)); +} -- cgit v1.2.3