fix: ability to create empty kanban (#6951)

## ISSUE
- Closes #6946
This commit is contained in:
Nabhag Motivaras
2024-09-09 19:40:40 +05:30
committed by GitHub
parent 1ff31a90f4
commit 2edab3fa2c

View File

@@ -79,6 +79,8 @@ export const ViewPickerCreateOrEditContent = () => {
const { handleCreate, handleUpdate } = useViewPickerPersistView();
const { availableFieldsForKanban } = useGetAvailableFieldsForKanban();
useScopedHotkeys(
Key.Enter,
async () => {
@@ -86,6 +88,12 @@ export const ViewPickerCreateOrEditContent = () => {
return;
}
if (viewPickerMode === 'create') {
if (
viewPickerType === ViewType.Kanban &&
availableFieldsForKanban.length === 0
) {
return;
}
await handleCreate();
}
if (viewPickerMode === 'edit') {
@@ -100,8 +108,6 @@ export const ViewPickerCreateOrEditContent = () => {
setViewPickerSelectedIcon(iconKey);
};
const { availableFieldsForKanban } = useGetAvailableFieldsForKanban();
const handleClose = async () => {
if (viewPickerMode === 'edit') {
await handleUpdate();