Skip to content

Commit

Permalink
Remove buggy exteded loading screen;
Browse files Browse the repository at this point in the history
  • Loading branch information
samwillis committed Dec 9, 2024
1 parent dad6d45 commit 455f7bb
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions examples/linearlite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ pgPromise.then(async (pg) => {
})
})

let resolveFirstLoaderPromise: (value: void | PromiseLike<void>) => void
const firstLoaderPromise = new Promise<void>((resolve) => {
resolveFirstLoaderPromise = resolve
})

async function issueListLoader({ request }: { request: Request }) {
await waitForInitialSyncDone()
const pg = await pgPromise
Expand All @@ -74,7 +69,6 @@ async function issueListLoader({ request }: { request: Request }) {
offset: 0,
limit: 100,
})
resolveFirstLoaderPromise()
return { liveIssues, filterState }
}

Expand Down Expand Up @@ -106,8 +100,6 @@ async function boardIssueListLoader({ request }: { request: Request }) {
columnsLiveIssues[status] = colLiveIssues
}

resolveFirstLoaderPromise()

return {
columnsLiveIssues: columnsLiveIssues as Record<
StatusValue,
Expand Down Expand Up @@ -178,19 +170,11 @@ const App = () => {
const [pgForProvider, setPgForProvider] =
useState<PGliteWorkerWithLive | null>(null)
const [syncStatus, syncMessage] = useSyncStatus()
const [firstLoaderDone, setFirstLoaderDone] = useState(false)

useEffect(() => {
pgPromise.then(setPgForProvider)
}, [])

useEffect(() => {
if (firstLoaderDone) return
firstLoaderPromise.then(() => {
setFirstLoaderDone(true)
})
}, [firstLoaderDone])

const menuContextValue = useMemo(
() => ({ showMenu, setShowMenu }),
[showMenu]
Expand All @@ -207,8 +191,6 @@ const App = () => {
</LoadingScreen>
)

if (!firstLoaderDone) return <LoadingScreen>Loading...</LoadingScreen>

return (
<PGliteProvider db={pgForProvider}>
<MenuContext.Provider value={menuContextValue}>
Expand Down

0 comments on commit 455f7bb

Please sign in to comment.