[WEB-1889] fix: handled tapping on a notification in Notifications from mobile in inbox issue and issue peek overview component (#5074)
* fix: handled tapping on a notification in Notifications from mobile in inbox issue and issue peekoverview component * fix: code cleanup * fix: code cleanup on workspace notification store * fix: updated selected notification on workspace notification store
This commit is contained in:
parent
a623456e63
commit
7767be2e21
10 changed files with 131 additions and 99 deletions
|
|
@ -17,6 +17,7 @@ import { useIssuesStore } from "@/hooks/use-issue-layout-store";
|
|||
|
||||
interface IIssuePeekOverview {
|
||||
embedIssue?: boolean;
|
||||
embedRemoveCurrentNotification?: () => void;
|
||||
is_archived?: boolean;
|
||||
is_draft?: boolean;
|
||||
}
|
||||
|
|
@ -45,7 +46,7 @@ export type TIssuePeekOperations = {
|
|||
};
|
||||
|
||||
export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
||||
const { embedIssue = false, is_archived = false, is_draft = false } = props;
|
||||
const { embedIssue = false, embedRemoveCurrentNotification, is_archived = false, is_draft = false } = props;
|
||||
// router
|
||||
const pathname = usePathname();
|
||||
const {
|
||||
|
|
@ -362,6 +363,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||
is_archived={is_archived}
|
||||
disabled={!isEditable}
|
||||
embedIssue={embedIssue}
|
||||
embedRemoveCurrentNotification={embedRemoveCurrentNotification}
|
||||
issueOperations={issueOperations}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ interface IIssueView {
|
|||
is_archived: boolean;
|
||||
disabled?: boolean;
|
||||
embedIssue?: boolean;
|
||||
embedRemoveCurrentNotification?: () => void;
|
||||
issueOperations: TIssueOperations;
|
||||
}
|
||||
|
||||
|
|
@ -43,6 +44,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||
is_archived,
|
||||
disabled = false,
|
||||
embedIssue = false,
|
||||
embedRemoveCurrentNotification,
|
||||
issueOperations,
|
||||
} = props;
|
||||
// states
|
||||
|
|
@ -64,13 +66,16 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||
// remove peek id
|
||||
const removeRoutePeekId = () => {
|
||||
setPeekIssue(undefined);
|
||||
if (embedIssue) embedRemoveCurrentNotification && embedRemoveCurrentNotification();
|
||||
};
|
||||
|
||||
usePeekOverviewOutsideClickDetector(
|
||||
issuePeekOverviewRef,
|
||||
() => {
|
||||
if (!isAnyModalOpen) {
|
||||
removeRoutePeekId();
|
||||
if (!embedIssue) {
|
||||
if (!isAnyModalOpen) {
|
||||
removeRoutePeekId();
|
||||
}
|
||||
}
|
||||
},
|
||||
issueId
|
||||
|
|
@ -86,7 +91,7 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||
}
|
||||
};
|
||||
|
||||
useKeypress("Escape", handleKeyDown);
|
||||
useKeypress("Escape", () => !embedIssue && handleKeyDown());
|
||||
|
||||
const handleRestore = async () => {
|
||||
if (!issueOperations.restore) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue