Plugin runtime v2 (#62)

This commit is contained in:
Gregory Schier
2024-08-08 21:30:59 -07:00
committed by GitHub
parent f967820f12
commit 063e6cf00c
64 changed files with 1539 additions and 705 deletions

View File

@@ -1,6 +1,6 @@
import { useCookieJars } from '../hooks/useCookieJars';
import { useUpdateCookieJar } from '../hooks/useUpdateCookieJar';
import type { Cookie } from '../lib/gen/Cookie';
import type { Cookie } from '../lib/models/Cookie';
import { cookieDomain } from '../lib/models';
import { Banner } from './core/Banner';
import { IconButton } from './core/IconButton';

View File

@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import { useLocalStorage } from 'react-use';
import { Button } from './core/Button';
import { VStack } from './core/Stacks';
import { SelectFile } from './SelectFile';
@@ -9,7 +10,7 @@ interface Props {
export function ImportDataDialog({ importData }: Props) {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [filePath, setFilePath] = useState<string | null>(null);
const [filePath, setFilePath] = useLocalStorage<string | null>('importFilePath', null);
return (
<VStack space={5} className="pb-4">
<VStack space={1}>
@@ -24,7 +25,10 @@ export function ImportDataDialog({ importData }: Props) {
</ul>
</VStack>
<VStack space={2}>
<SelectFile filePath={filePath} onChange={({ filePath }) => setFilePath(filePath)} />
<SelectFile
filePath={filePath ?? null}
onChange={({ filePath }) => setFilePath(filePath)}
/>
{filePath && (
<Button
color="primary"

View File

@@ -167,7 +167,7 @@ export function TextViewer({ response, pretty, className }: Props) {
if (filteredResponse.error) {
body = '';
} else {
body = filteredResponse.data ?? '';
body = filteredResponse.data != null ? filteredResponse.data : '';
}
} else {
body = formattedBody;