diff --git a/src/renderer.jsx b/src/renderer.jsx index 8ed5ab2..580ca1d 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -191,7 +191,7 @@ function render() { const href = event .composedPath()[0] .href.replace("app://./renderer/", ""); - await markdown_it.open_link(href); + await LiteLoader.api.openExternal(href); return false; }; }) diff --git a/src/states/settings.ts b/src/states/settings.ts index 0b0957c..52ea52d 100644 --- a/src/states/settings.ts +++ b/src/states/settings.ts @@ -2,7 +2,7 @@ import { create } from 'zustand'; import { immer } from 'zustand/middleware/immer'; import { persist, createJSONStorage, subscribeWithSelector } from 'zustand/middleware'; -import { LiteLoaderStorage } from '@/utils/liteloaderConfig'; +import { LiteLoaderStorage } from '@/utils/liteloader_config'; export interface SettingStateProperties { // Boolean properties diff --git a/src/utils/liteloaderConfig.ts b/src/utils/liteloader_config.ts similarity index 66% rename from src/utils/liteloaderConfig.ts rename to src/utils/liteloader_config.ts index adbf625..ddcccc6 100644 --- a/src/utils/liteloaderConfig.ts +++ b/src/utils/liteloader_config.ts @@ -3,20 +3,7 @@ import { StateStorage } from 'zustand/middleware'; - -/** - * The interface for QQNT Liteloader dev api. - * - * Notice the `new_config` and `default_config` should all be a Object. Passing string will cause unexpected behaviour. - */ -interface LiteLoaderInterFace { - api: { - config: { - set(slug: string, new_config: T): Promise; - get(slug: string, default_config: T): Promise; - } - } -}; +import { LiteLoaderInterFace } from '@/utils/liteloader_type'; declare const LiteLoader: LiteLoaderInterFace; diff --git a/src/utils/liteloader_type.ts b/src/utils/liteloader_type.ts new file mode 100644 index 0000000..03c3527 --- /dev/null +++ b/src/utils/liteloader_type.ts @@ -0,0 +1,15 @@ +/** + * The interface for QQNT Liteloader dev api. + * + * Notice the `new_config` and `default_config` should all be a Object. Passing string will cause unexpected behaviour. + */ +export interface LiteLoaderInterFace { + api: { + openPath(path: string): any; + openExternal(uri: string): any; + config: { + set(slug: string, new_config: T): Promise; + get(slug: string, default_config: T): Promise; + } + }, +}; \ No newline at end of file