This commit is contained in:
zhu
2026-05-09 18:49:15 +08:00
parent 37c22705cf
commit bf6b44a950
25 changed files with 836 additions and 86 deletions

View File

@@ -1,35 +1,32 @@
import {create} from "zustand";
type ExtensionState = {
/*** 是否安装了扩展*/
isInstalled: boolean,
/*** 是否第一次*/
isFirst: boolean,
/*** 是否抓取中*/
isFetching: boolean,
extensionInfo: ExtensionInfo,
isInstalled: boolean;
isFirst: boolean;
isFetching: boolean;
lastScanError: string;
extensionInfo: ExtensionInfo;
setInstalled: (status: boolean) => void;
setFetching: (status: boolean) => void;
setLastScanError: (message: string) => void;
}
/**
* 扩展信息
*/
type ExtensionInfo = {
//下载地址
downloadUrl: string,
//扩展商店
chromeUrl: string,
downloadUrl: string;
chromeUrl: string;
}
const useExtensionStore = create<ExtensionState>((set) => ({
isInstalled: false,
isFirst: true,
isFetching: false,
lastScanError: "",
extensionInfo: {
downloadUrl: "/extensions/storeai-extension-v0.1.4.zip",
chromeUrl:"chrome://extensions"
},
setInstalled: (value) => set({isInstalled: value}),
setFetching: (value) => set({isFetching: value}),
setLastScanError: (value) => set({lastScanError: value}),
}))
export default useExtensionStore
export default useExtensionStore