Commit 53bcd413 by heheer Committed by GitHub

app detail visibility (#5178)

parent b0150635
...@@ -276,6 +276,10 @@ const Render = (props: { appId: string; isStandalone?: string }) => { ...@@ -276,6 +276,10 @@ const Render = (props: { appId: string; isStandalone?: string }) => {
setAppId(appId); setAppId(appId);
}, [appId, setAppId]); }, [appId, setAppId]);
const currentApp = useMemo(() => {
return myApps.find((app) => app._id === appId);
}, [appId, myApps]);
const chatHistoryProviderParams = useMemo( const chatHistoryProviderParams = useMemo(
() => ({ appId, source: ChatSourceEnum.online }), () => ({ appId, source: ChatSourceEnum.online }),
[appId] [appId]
...@@ -291,7 +295,7 @@ const Render = (props: { appId: string; isStandalone?: string }) => { ...@@ -291,7 +295,7 @@ const Render = (props: { appId: string; isStandalone?: string }) => {
return source === ChatSourceEnum.online ? ( return source === ChatSourceEnum.online ? (
<ChatContextProvider params={chatHistoryProviderParams}> <ChatContextProvider params={chatHistoryProviderParams}>
<ChatItemContextProvider <ChatItemContextProvider
showRouteToAppDetail={isStandalone !== '1'} showRouteToAppDetail={isStandalone !== '1' && !!currentApp?.permission.hasWritePer}
showRouteToDatasetDetail={isStandalone !== '1'} showRouteToDatasetDetail={isStandalone !== '1'}
isShowReadRawSource={true} isShowReadRawSource={true}
isResponseDetail={true} isResponseDetail={true}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment