Skip to content

Commit

Permalink
fix: attachment delete modal (makeplane#5080)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Jul 8, 2024
1 parent 53e5d4b commit 6c2b28d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const IssueAttachmentsListItem: FC<TIssueAttachmentsListItem> = observer(
<>
{isDeleteAttachmentModalOpen && (
<IssueAttachmentDeleteModal
isOpen={!!isDeleteAttachmentModalOpen}
onClose={() => toggleDeleteAttachmentModal(null)}
isOpen={isDeleteAttachmentModalOpen}
onClose={() => toggleDeleteAttachmentModal(false)}
handleAttachmentOperations={handleAttachmentOperations}
data={attachment}
/>
Expand Down Expand Up @@ -95,7 +95,7 @@ export const IssueAttachmentsListItem: FC<TIssueAttachmentsListItem> = observer(
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
toggleDeleteAttachmentModal(attachmentId);
toggleDeleteAttachmentModal(true);
}}
>
<div className="flex items-center gap-2">
Expand Down
12 changes: 6 additions & 6 deletions web/core/store/issue/issue-details/root.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface IIssueDetail
isArchiveIssueModalOpen: string | null;
isRelationModalOpen: TIssueRelationModal | null;
isSubIssuesModalOpen: string | null;
isDeleteAttachmentModalOpen: string | null;
isDeleteAttachmentModalOpen: boolean;
// computed
isAnyModalOpen: boolean;
// helper actions
Expand All @@ -71,7 +71,7 @@ export interface IIssueDetail
toggleArchiveIssueModal: (value: string | null) => void;
toggleRelationModal: (issueId: string | null, relationType: TIssueRelationTypes | null) => void;
toggleSubIssuesModal: (value: string | null) => void;
toggleDeleteAttachmentModal: (attachmentId: string | null) => void;
toggleDeleteAttachmentModal: (value:boolean) => void;
// store
rootIssueStore: IIssueRootStore;
issue: IIssueStore;
Expand All @@ -96,7 +96,7 @@ export class IssueDetail implements IIssueDetail {
isArchiveIssueModalOpen: string | null = null;
isRelationModalOpen: TIssueRelationModal | null = null;
isSubIssuesModalOpen: string | null = null;
isDeleteAttachmentModalOpen: string | null = null;
isDeleteAttachmentModalOpen: boolean = false;
// store
rootIssueStore: IIssueRootStore;
issue: IIssueStore;
Expand All @@ -121,7 +121,7 @@ export class IssueDetail implements IIssueDetail {
isArchiveIssueModalOpen: observable.ref,
isRelationModalOpen: observable.ref,
isSubIssuesModalOpen: observable.ref,
isDeleteAttachmentModalOpen: observable.ref,
isDeleteAttachmentModalOpen: observable,
// computed
isAnyModalOpen: computed,
// action
Expand Down Expand Up @@ -160,7 +160,7 @@ export class IssueDetail implements IIssueDetail {
!!this.isArchiveIssueModalOpen ||
!!this.isRelationModalOpen?.issueId ||
!!this.isSubIssuesModalOpen ||
!!this.isDeleteAttachmentModalOpen
this.isDeleteAttachmentModalOpen
);
}

Expand All @@ -177,7 +177,7 @@ export class IssueDetail implements IIssueDetail {
toggleRelationModal = (issueId: string | null, relationType: TIssueRelationTypes | null) =>
(this.isRelationModalOpen = { issueId, relationType });
toggleSubIssuesModal = (issueId: string | null) => (this.isSubIssuesModalOpen = issueId);
toggleDeleteAttachmentModal = (attachmentId: string | null) => (this.isDeleteAttachmentModalOpen = attachmentId);
toggleDeleteAttachmentModal = (value: boolean) => (this.isDeleteAttachmentModalOpen = value);

// issue
fetchIssue = async (
Expand Down

0 comments on commit 6c2b28d

Please sign in to comment.