mirror of https://github.com/langgenius/dify.git
app list mutation
This commit is contained in:
parent
e13f8da9d5
commit
62919a9ff5
|
|
@ -53,7 +53,7 @@ const Apps = () => {
|
|||
const { data, isLoading, setSize, mutate } = useSWRInfinite(
|
||||
(pageIndex: number, previousPageData: AppListResponse) => getKey(pageIndex, previousPageData, activeTab, searchKeywords),
|
||||
fetchAppList,
|
||||
{ revalidateFirstPage: false },
|
||||
{ revalidateFirstPage: true },
|
||||
)
|
||||
|
||||
const anchorRef = useRef<HTMLDivElement>(null)
|
||||
|
|
@ -71,7 +71,7 @@ const Apps = () => {
|
|||
localStorage.removeItem(NEED_REFRESH_APP_LIST_KEY)
|
||||
mutate()
|
||||
}
|
||||
}, [mutate, t])
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
let observer: IntersectionObserver | undefined
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
|
|||
notify({ type: 'success', message: t('app.appDeleted') })
|
||||
mutateApps()
|
||||
onPlanInfoChanged()
|
||||
setAppDetail()
|
||||
replace('/apps')
|
||||
}
|
||||
catch (e: any) {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ const AppContext = createContext<AppContextValue>({
|
|||
},
|
||||
currentWorkspace: initialWorkspaceInfo,
|
||||
isCurrentWorkspaceManager: false,
|
||||
isCurrentWorkspaceOwner: false,
|
||||
mutateUserProfile: () => { },
|
||||
mutateCurrentWorkspace: () => { },
|
||||
pageContainerRef: createRef(),
|
||||
|
|
@ -76,7 +77,7 @@ export type AppContextProviderProps = {
|
|||
export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) => {
|
||||
const pageContainerRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
const { data: appList, mutate: mutateApps } = useSWR({ url: '/apps', params: { page: 1 } }, fetchAppList)
|
||||
const { data: appList, mutate: mutateApps } = useSWR({ url: '/apps', params: { page: 1, limit: 30, name: '' } }, fetchAppList)
|
||||
const { data: userProfileResponse, mutate: mutateUserProfile } = useSWR({ url: '/account/profile', params: {} }, fetchUserProfile)
|
||||
const { data: currentWorkspaceResponse, mutate: mutateCurrentWorkspace } = useSWR({ url: '/workspaces/current', params: {} }, fetchCurrentWorkspace)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue