fix(channel): 修复模型填入与检查问题
This commit is contained in:
@@ -1708,6 +1708,7 @@ const EditChannelModal = (props) => {
|
||||
|
||||
setModelOptions(localModelOptions);
|
||||
setCustomModel('');
|
||||
formApiRef.current?.setValue('custom_model', '');
|
||||
handleInputChange('models', localModels);
|
||||
|
||||
if (addedModels.length > 0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
import { useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { API } from '../../helpers/api';
|
||||
import { UserContext } from '../../context/User';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
@@ -29,7 +29,10 @@ export function usePartnerWorkspaceAccess(organizationId = null) {
|
||||
const [userState] = useContext(UserContext);
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const user = userState?.user;
|
||||
const scope = partnerScope(user?.id, organizationId);
|
||||
const scope = useMemo(
|
||||
() => partnerScope(user?.id, organizationId),
|
||||
[user?.id, organizationId],
|
||||
);
|
||||
const portalEnabled = statusState?.status?.commission_partner_portal_enabled;
|
||||
// 分佣总开关关闭时不发起伙伴身份探测;旧后端不返回该字段,视为开启。
|
||||
const commissionEnabled = statusState?.status?.commission_enabled !== false;
|
||||
@@ -58,7 +61,7 @@ export function usePartnerWorkspaceAccess(organizationId = null) {
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [enabled, user, attempt, scope.key]);
|
||||
}, [enabled, user, attempt, scope]);
|
||||
|
||||
// 绑定本次登录的用户快照,切换账号时在 effect 执行前就隐藏旧入口。
|
||||
let status = 'loading';
|
||||
|
||||
@@ -456,9 +456,10 @@ const Organization = () => {
|
||||
}, [orgId, user]);
|
||||
|
||||
useEffect(() => {
|
||||
const requestState = orgRequest;
|
||||
fetchOrgInfo();
|
||||
return () => {
|
||||
orgRequest.current++;
|
||||
requestState.current++;
|
||||
};
|
||||
}, [fetchOrgInfo]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user