Fix response emit and sidebar flex

This commit is contained in:
Gregory Schier
2024-02-09 16:16:02 -08:00
parent cae9a4fd36
commit bbe62abd20
5 changed files with 27 additions and 24 deletions

View File

@@ -92,7 +92,7 @@ export function GlobalHooks() {
});
});
useListenToTauriEvent<Model>('deleted_model', ({ payload, windowLabel }) => {
useListenToTauriEvent<Model>('deleted_model', ({ payload }) => {
if (shouldIgnoreModel(payload)) return;
if (payload.model === 'workspace') {

View File

@@ -743,7 +743,7 @@ const SidebarItem = forwardRef(function SidebarItem(
data-active={isActive}
data-selected={selected}
className={classNames(
'w-full flex gap-2 items-center text-sm h-xs pl-2 rounded-md transition-colors',
'w-full flex gap-2 items-center text-sm h-xs px-1.5 rounded-md transition-colors',
editing && 'ring-1 focus-within:ring-focus',
isActive && 'bg-highlightSecondary text-gray-800',
!isActive &&
@@ -774,22 +774,22 @@ const SidebarItem = forwardRef(function SidebarItem(
) : (
<span className="truncate">{itemName || itemFallbackName}</span>
)}
{latestGrpcConnection ? (
<div className="ml-auto">
{latestGrpcConnection.elapsed === 0 && (
<Icon spin size="sm" icon="update" className="text-gray-400" />
)}
</div>
) : latestHttpResponse ? (
<div className="ml-auto">
{isResponseLoading(latestHttpResponse) ? (
<Icon spin size="sm" icon="update" className="text-gray-400" />
) : (
<StatusTag className="text-2xs dark:opacity-80" response={latestHttpResponse} />
)}
</div>
) : null}
</div>
{latestGrpcConnection ? (
<div className="ml-auto">
{latestGrpcConnection.elapsed === 0 && (
<Icon spin size="sm" icon="update" className="text-gray-400" />
)}
</div>
) : latestHttpResponse ? (
<div className="ml-auto">
{isResponseLoading(latestHttpResponse) ? (
<Icon spin size="sm" icon="update" className="text-gray-400" />
) : (
<StatusTag className="text-2xs dark:opacity-80" response={latestHttpResponse} />
)}
</div>
) : null}
</button>
</div>
{children}

View File

@@ -31,7 +31,7 @@ export function useSendAnyRequest(options: { download?: boolean } = {}) {
}
}
return invoke('cmd_send_request', {
return invoke('cmd_send_http_request', {
requestId: id,
environmentId,
downloadDir: downloadDir,