fix: not available message showing at wrong time

This commit is contained in:
Samuel 2025-01-21 20:23:10 +01:00
parent ff23486fd2
commit c7437d3610

View file

@ -105,14 +105,14 @@ export const columns = [
cell: (props) => { cell: (props) => {
const isArchived = props.row.getValue("archived"); const isArchived = props.row.getValue("archived");
const isGroup = props.row.getValue("isGroup"); const isGroup = props.row.getValue("isGroup");
const isCached = !dbLoaded() && rowIsAvailable(props.row.original.threadId); const isNotAvailable = !rowIsAvailable(props.row.original.threadId);
return ( return (
<Flex class="w-full" flexDirection="row"> <Flex class="w-full" flexDirection="row">
<span class="max-w-2xl overflow-hidden text-ellipsis whitespace-nowrap font-bold"> <span class="max-w-2xl overflow-hidden text-ellipsis whitespace-nowrap font-bold">
{props.cell.getValue()} {props.cell.getValue()}
</span> </span>
<Show when={isArchived || isGroup || !isCached}> <Show when={isArchived || isGroup || isNotAvailable}>
<Flex flexDirection="row" class="ml-auto gap-2"> <Flex flexDirection="row" class="ml-auto gap-2">
<Show when={isArchived}> <Show when={isArchived}>
<Badge variant="outline" class="ml-auto"> <Badge variant="outline" class="ml-auto">
@ -124,7 +124,7 @@ export const columns = [
Group Group
</Badge> </Badge>
</Show> </Show>
<Show when={!isCached}> <Show when={isNotAvailable}>
<Badge variant="outline" class="ml-auto"> <Badge variant="outline" class="ml-auto">
Not available Not available
</Badge> </Badge>