mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 16:31:18 +02:00
Better non-named requests
This commit is contained in:
@@ -471,7 +471,7 @@ type SidebarItemProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
itemId: string;
|
itemId: string;
|
||||||
itemName: string;
|
itemName: string;
|
||||||
itemFallbackName: string;
|
itemFallbackName: string | null;
|
||||||
itemModel: string;
|
itemModel: string;
|
||||||
useProminentStyles?: boolean;
|
useProminentStyles?: boolean;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
@@ -668,8 +668,6 @@ const SidebarItem = forwardRef(function SidebarItem(
|
|||||||
!isActive &&
|
!isActive &&
|
||||||
'text-gray-600 group-hover/item:text-gray-800 active:bg-highlightSecondary',
|
'text-gray-600 group-hover/item:text-gray-800 active:bg-highlightSecondary',
|
||||||
selected && useProminentStyles && '!bg-violet-400/20',
|
selected && useProminentStyles && '!bg-violet-400/20',
|
||||||
!itemName && selected && '!text-gray-600 italic',
|
|
||||||
!itemName && !selected && '!text-gray-400 italic',
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{itemModel === 'folder' && (
|
{itemModel === 'folder' && (
|
||||||
@@ -779,15 +777,15 @@ function DraggableSidebarItem({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultRequestName(r: HttpRequest) {
|
function defaultRequestName(r: HttpRequest): string | null {
|
||||||
if (!r.url) {
|
if (!r.url) {
|
||||||
return 'New Request';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const url = new URL(r.url);
|
const url = new URL(r.url);
|
||||||
return url.pathname != '/' ? url.host + url.pathname : url.host;
|
return url.pathname != '/' ? url.host + url.pathname : url.host;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return '';
|
return r.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user