Skip to content

Commit 892cf92

Browse files
authored
feat(code): do not show task list empty state until fetch is complete (#1924)
## Problem when launching the app, the task list instantly shows the empty state, _then_ transitions to the loading state, creating a weird UX flash of the empty state when we don't actually know if it's empty yet <!-- Who is this for and what problem does it solve? --> <!-- Closes #ISSUE_ID --> ## Changes updates so we don't show the empty state til the fetch is done <!-- What did you change and why? --> <!-- If there are frontend changes, include screenshots. --> ## How did you test this? manually
1 parent d52f366 commit 892cf92

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/code/src/renderer/features/sidebar/hooks/useSidebarData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ export function useSidebarData({
7979
activeView,
8080
}: UseSidebarDataProps): SidebarData {
8181
const showAllUsers = useSidebarStore((state) => state.showAllUsers);
82-
const { data: rawTasks = [], isLoading: isLoadingTasks } = useTasks({
82+
const { data: rawTasks = [], isFetched: isTasksFetched } = useTasks({
8383
showAllUsers,
8484
});
8585
const { data: workspaces, isFetched: isWorkspacesFetched } = useWorkspaces();
8686
const archivedTaskIds = useArchivedTaskIds();
8787
const suspendedTaskIds = useSuspendedTaskIds();
88-
const isLoading = isLoadingTasks || !isWorkspacesFetched;
88+
const isLoading = !isTasksFetched || !isWorkspacesFetched;
8989
const allTasks = useMemo(
9090
() =>
9191
rawTasks.filter(

0 commit comments

Comments
 (0)