Fix app directory migration bugs (#4745)

Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
This commit is contained in:
Prateek Shourya 2024-06-10 14:18:30 +05:30 committed by GitHub
parent a04fb07406
commit f93803ace8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 191 deletions

View file

@ -44,7 +44,9 @@ export interface IIssueProperties {
export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
// router
const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug, projectId } = useParams();
const pathname = usePathname();
const { issue, updateIssue, displayProperties, activeLayout, isReadOnly, className } = props;
// store hooks
const { getProjectById } = useProject();
@ -60,10 +62,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
const { getStateById } = useProjectState();
const { isMobile } = usePlatformOS();
const projectDetails = getProjectById(issue.project_id);
// router
const router = useRouter();
const { workspaceSlug } = useParams();
const pathname = usePathname();
const currentLayout = `${activeLayout} layout`;
// derived values
const stateDetails = getStateById(issue.state_id);

View file

@ -145,21 +145,6 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
useKeypress("Escape", handleKeyDown);
const handleKeyDown = (event: KeyboardEvent) => {
if (editorRef.current?.isEditorReadyToDiscard()) {
onClose();
} else {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: "Editor is still processing changes. Please wait before proceeding.",
});
event.preventDefault(); // Prevent default action if editor is not ready to discard
}
};
useKeypress("Escape", handleKeyDown);
const {
issue: { getIssueById },
} = useIssueDetail();