feat: chat ui

This commit is contained in:
archer
2023-07-26 11:01:25 +08:00
parent 2b993b926a
commit 248be38939
19 changed files with 153 additions and 54 deletions

View File

@@ -19,7 +19,7 @@ type State = {
updateUserInfo: (user: UserUpdateParams) => void;
myApps: AppListItemType[];
myCollectionApps: AppListItemType[];
loadMyModels: () => Promise<null>;
loadMyApps: () => Promise<AppListItemType[]>;
appDetail: AppSchema;
loadAppDetail: (id: string, init?: boolean) => Promise<AppSchema>;
updateAppDetail(appId: string, data: AppUpdateParams): Promise<void>;
@@ -63,12 +63,12 @@ export const useUserStore = create<State>()(
},
myApps: [],
myCollectionApps: [],
async loadMyModels() {
async loadMyApps() {
const res = await getMyModels();
set((state) => {
state.myApps = res;
});
return null;
return res;
},
appDetail: defaultApp,
async loadAppDetail(id: string, init = false) {