mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 14:59:42 +02:00
Fix lint errors
This commit is contained in:
@@ -86,7 +86,7 @@ export function Sidebar({ className }: Props) {
|
|||||||
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
|
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
|
||||||
const collapsed = useKeyValue<Record<string, boolean>>({
|
const collapsed = useKeyValue<Record<string, boolean>>({
|
||||||
key: ['sidebar_collapsed', activeWorkspace?.id ?? 'n/a'],
|
key: ['sidebar_collapsed', activeWorkspace?.id ?? 'n/a'],
|
||||||
defaultValue: {},
|
fallback: {},
|
||||||
namespace: NAMESPACE_NO_SYNC,
|
namespace: NAMESPACE_NO_SYNC,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function useActiveCookieJar() {
|
|||||||
const kv = useKeyValue<string | null>({
|
const kv = useKeyValue<string | null>({
|
||||||
namespace: NAMESPACE_GLOBAL,
|
namespace: NAMESPACE_GLOBAL,
|
||||||
key: ['activeCookieJar', workspaceId ?? 'n/a'],
|
key: ['activeCookieJar', workspaceId ?? 'n/a'],
|
||||||
defaultValue: null,
|
fallback: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const activeCookieJar = cookieJars.find((cookieJar) => cookieJar.id === kv.value);
|
const activeCookieJar = cookieJars.find((cookieJar) => cookieJar.id === kv.value);
|
||||||
|
|||||||
@@ -54,6 +54,6 @@ export function useCreateDropdownItems({
|
|||||||
},
|
},
|
||||||
]) as DropdownItem[]),
|
]) as DropdownItem[]),
|
||||||
],
|
],
|
||||||
[createFolder, createGrpcRequest, createHttpRequest, hideFolder],
|
[createFolder, createGrpcRequest, createHttpRequest, folderId, hideFolder, hideIcons],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useKeyValue } from './useKeyValue';
|
|||||||
|
|
||||||
const kvKey = (workspaceId: string) => 'recent_environments::' + workspaceId;
|
const kvKey = (workspaceId: string) => 'recent_environments::' + workspaceId;
|
||||||
const namespace = NAMESPACE_GLOBAL;
|
const namespace = NAMESPACE_GLOBAL;
|
||||||
const defaultValue: string[] = [];
|
const fallback: string[] = [];
|
||||||
|
|
||||||
export function useRecentEnvironments() {
|
export function useRecentEnvironments() {
|
||||||
const environments = useEnvironments();
|
const environments = useEnvironments();
|
||||||
@@ -16,7 +16,7 @@ export function useRecentEnvironments() {
|
|||||||
const kv = useKeyValue<string[]>({
|
const kv = useKeyValue<string[]>({
|
||||||
key: kvKey(activeWorkspaceId ?? 'n/a'),
|
key: kvKey(activeWorkspaceId ?? 'n/a'),
|
||||||
namespace,
|
namespace,
|
||||||
defaultValue,
|
fallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set history when active request changes
|
// Set history when active request changes
|
||||||
@@ -41,6 +41,6 @@ export async function getRecentEnvironments(workspaceId: string) {
|
|||||||
return getKeyValue<string[]>({
|
return getKeyValue<string[]>({
|
||||||
namespace,
|
namespace,
|
||||||
key: kvKey(workspaceId),
|
key: kvKey(workspaceId),
|
||||||
fallback: defaultValue,
|
fallback,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useKeyValue } from './useKeyValue';
|
|||||||
|
|
||||||
const kvKey = (workspaceId: string) => 'recent_requests::' + workspaceId;
|
const kvKey = (workspaceId: string) => 'recent_requests::' + workspaceId;
|
||||||
const namespace = NAMESPACE_GLOBAL;
|
const namespace = NAMESPACE_GLOBAL;
|
||||||
const defaultValue: string[] = [];
|
const fallback: string[] = [];
|
||||||
|
|
||||||
export function useRecentRequests() {
|
export function useRecentRequests() {
|
||||||
const httpRequests = useHttpRequests();
|
const httpRequests = useHttpRequests();
|
||||||
@@ -20,7 +20,7 @@ export function useRecentRequests() {
|
|||||||
const kv = useKeyValue<string[]>({
|
const kv = useKeyValue<string[]>({
|
||||||
key: kvKey(activeWorkspaceId ?? 'n/a'),
|
key: kvKey(activeWorkspaceId ?? 'n/a'),
|
||||||
namespace,
|
namespace,
|
||||||
defaultValue,
|
fallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set history when active request changes
|
// Set history when active request changes
|
||||||
@@ -45,6 +45,6 @@ export async function getRecentRequests(workspaceId: string) {
|
|||||||
return getKeyValue<string[]>({
|
return getKeyValue<string[]>({
|
||||||
namespace,
|
namespace,
|
||||||
key: kvKey(workspaceId),
|
key: kvKey(workspaceId),
|
||||||
fallback: defaultValue,
|
fallback,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useWorkspaces } from './useWorkspaces';
|
|||||||
|
|
||||||
const kvKey = () => 'recent_workspaces';
|
const kvKey = () => 'recent_workspaces';
|
||||||
const namespace = NAMESPACE_GLOBAL;
|
const namespace = NAMESPACE_GLOBAL;
|
||||||
const defaultValue: string[] = [];
|
const fallback: string[] = [];
|
||||||
|
|
||||||
export function useRecentWorkspaces() {
|
export function useRecentWorkspaces() {
|
||||||
const workspaces = useWorkspaces();
|
const workspaces = useWorkspaces();
|
||||||
@@ -14,7 +14,7 @@ export function useRecentWorkspaces() {
|
|||||||
const kv = useKeyValue<string[]>({
|
const kv = useKeyValue<string[]>({
|
||||||
key: kvKey(),
|
key: kvKey(),
|
||||||
namespace,
|
namespace,
|
||||||
defaultValue,
|
fallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set history when active request changes
|
// Set history when active request changes
|
||||||
@@ -39,6 +39,6 @@ export async function getRecentWorkspaces() {
|
|||||||
return getKeyValue<string[]>({
|
return getKeyValue<string[]>({
|
||||||
namespace,
|
namespace,
|
||||||
key: kvKey(),
|
key: kvKey(),
|
||||||
fallback: defaultValue,
|
fallback: fallback,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export function useSidebarHidden() {
|
|||||||
const { set, value } = useKeyValue<boolean>({
|
const { set, value } = useKeyValue<boolean>({
|
||||||
namespace: NAMESPACE_NO_SYNC,
|
namespace: NAMESPACE_NO_SYNC,
|
||||||
key: ['sidebar_hidden', activeWorkspaceId ?? 'n/a'],
|
key: ['sidebar_hidden', activeWorkspaceId ?? 'n/a'],
|
||||||
defaultValue: false,
|
fallback: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user