This commit is contained in:
lloydzhou
2024-08-30 23:39:08 +08:00
parent 271f58d9cf
commit 9326ff9d08
10 changed files with 47 additions and 28 deletions

View File

@@ -46,8 +46,8 @@ export function PluginPage() {
const onSearch = (text: string) => {
setSearchText(text);
if (text.length > 0) {
const result = allPlugins.filter((m) =>
m.title.toLowerCase().includes(text.toLowerCase()),
const result = allPlugins.filter(
(m) => m?.title.toLowerCase().includes(text.toLowerCase()),
);
setSearchPlugins(result);
} else {
@@ -63,7 +63,9 @@ export function PluginPage() {
const onChangePlugin = useDebouncedCallback((editingPlugin, e) => {
const content = e.target.innerText;
try {
const api = new OpenAPIClientAxios({ definition: yaml.load(content) });
const api = new OpenAPIClientAxios({
definition: yaml.load(content) as any,
});
api
.init()
.then(() => {