fix: instance config errors
This commit is contained in:
parent
895fbcd5a7
commit
31ca9e447d
35 changed files with 159 additions and 197 deletions
|
|
@ -21,7 +21,7 @@ type Props = {
|
|||
export const IssueAttachmentUpload: React.FC<Props> = observer((props) => {
|
||||
const { workspaceSlug, disabled = false, handleAttachmentOperations } = props;
|
||||
// store hooks
|
||||
const { instance } = useInstance();
|
||||
const { config } = useInstance();
|
||||
// states
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
|
|
@ -50,12 +50,12 @@ export const IssueAttachmentUpload: React.FC<Props> = observer((props) => {
|
|||
|
||||
const { getRootProps, getInputProps, isDragActive, isDragReject, fileRejections } = useDropzone({
|
||||
onDrop,
|
||||
maxSize: instance?.config?.file_size_limit ?? MAX_FILE_SIZE,
|
||||
maxSize: config?.file_size_limit ?? MAX_FILE_SIZE,
|
||||
multiple: false,
|
||||
disabled: isLoading || disabled,
|
||||
});
|
||||
|
||||
const maxFileSize = instance?.config?.file_size_limit ?? MAX_FILE_SIZE;
|
||||
const maxFileSize = config?.file_size_limit ?? MAX_FILE_SIZE;
|
||||
|
||||
const fileError =
|
||||
fileRejections.length > 0 ? `Invalid file type or size (max ${maxFileSize / 1024 / 1024} MB)` : null;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
|||
const workspaceStore = useWorkspace();
|
||||
const workspaceId = workspaceStore.getWorkspaceBySlug(workspaceSlug as string)?.id as string;
|
||||
const { projectId: routeProjectId } = useAppRouter();
|
||||
const { instance } = useInstance();
|
||||
const { config } = useInstance();
|
||||
const { getProjectById } = useProject();
|
||||
const { areEstimatesEnabledForProject } = useEstimate();
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
|||
) : (
|
||||
<>
|
||||
<div className="border-0.5 absolute bottom-3.5 right-3.5 z-10 flex items-center gap-2">
|
||||
{issueName && issueName.trim() !== "" && instance?.config?.has_openai_configured && (
|
||||
{issueName && issueName.trim() !== "" && config?.has_openai_configured && (
|
||||
<button
|
||||
type="button"
|
||||
className={`flex items-center gap-1 rounded bg-custom-background-90 px-1.5 py-1 text-xs ${
|
||||
|
|
@ -429,7 +429,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
|||
)}
|
||||
</button>
|
||||
)}
|
||||
{instance?.config?.has_openai_configured && (
|
||||
{config?.has_openai_configured && (
|
||||
<GptAssistantPopover
|
||||
isOpen={gptAssistantModal}
|
||||
projectId={projectId}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue