diff --git a/api/controllers/console/workspace/workspace.py b/api/controllers/console/workspace/workspace.py index cd72872b6..7a11a45ae 100644 --- a/api/controllers/console/workspace/workspace.py +++ b/api/controllers/console/workspace/workspace.py @@ -161,13 +161,13 @@ class CustomConfigWorkspaceApi(Resource): parser.add_argument('replace_webapp_logo', type=str, location='json') args = parser.parse_args() + tenant = db.session.query(Tenant).filter(Tenant.id == current_user.current_tenant_id).one_or_404() + custom_config_dict = { 'remove_webapp_brand': args['remove_webapp_brand'], - 'replace_webapp_logo': args['replace_webapp_logo'], + 'replace_webapp_logo': args['replace_webapp_logo'] if args['replace_webapp_logo'] is not None else tenant.custom_config_dict.get('replace_webapp_logo') , } - tenant = db.session.query(Tenant).filter(Tenant.id == current_user.current_tenant_id).one_or_404() - tenant.custom_config_dict = custom_config_dict db.session.commit() diff --git a/web/app/components/base/chat/chat-with-history/config-panel/index.tsx b/web/app/components/base/chat/chat-with-history/config-panel/index.tsx index f49dcbab0..649aa5037 100644 --- a/web/app/components/base/chat/chat-with-history/config-panel/index.tsx +++ b/web/app/components/base/chat/chat-with-history/config-panel/index.tsx @@ -146,14 +146,14 @@ const ConfigPanel = () => { ? null : (
) } diff --git a/web/app/components/custom/custom-web-app-brand/index.tsx b/web/app/components/custom/custom-web-app-brand/index.tsx index 857706bf2..71b18909a 100644 --- a/web/app/components/custom/custom-web-app-brand/index.tsx +++ b/web/app/components/custom/custom-web-app-brand/index.tsx @@ -29,6 +29,7 @@ const CustomWebAppBrand = () => { isCurrentWorkspaceManager, } = useAppContext() const [fileId, setFileId] = useState('') + const [imgKey, setImgKey] = useState(Date.now()) const [uploadProgress, setUploadProgress] = useState(0) const isSandbox = enableBilling && plan.type === Plan.sandbox const uploading = uploadProgress > 0 && uploadProgress < 100 @@ -73,6 +74,7 @@ const CustomWebAppBrand = () => { }) mutateCurrentWorkspace() setFileId('') + setImgKey(Date.now()) } const handleRestore = async () => { @@ -80,7 +82,7 @@ const CustomWebAppBrand = () => { url: '/workspaces/custom-config', body: { remove_webapp_brand: false, - replace_webapp_logo: null, + replace_webapp_logo: '', }, }) mutateCurrentWorkspace() @@ -91,7 +93,6 @@ const CustomWebAppBrand = () => { url: '/workspaces/custom-config', body: { remove_webapp_brand: checked, - replace_webapp_logo: webappLogo, }, }) mutateCurrentWorkspace() @@ -121,7 +122,7 @@ const CustomWebAppBrand = () => { POWERED BY { webappLogo - ? + ? :