fix modules and cycle peek views (#5261)

This commit is contained in:
rahulramesha 2024-07-30 13:53:19 +05:30 committed by GitHub
parent e3143ff00b
commit f2af5f0653
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View file

@ -139,7 +139,7 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
e.stopPropagation();
const query = generateQueryParams(searchParams, ["peekCycle"]);
if (searchParams.has("peekCycle")) {
if (searchParams.has("peekCycle") && searchParams.get("peekCycle") === cycleId) {
router.push(`${pathname}?${query}`);
} else {
router.push(`${pathname}?${query && `${query}&`}peekCycle=${cycleId}`);

View file

@ -70,7 +70,7 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
e.stopPropagation();
const query = generateQueryParams(searchParams, ["peekCycle"]);
if (searchParams.has("peekCycle")) {
if (searchParams.has("peekCycle") && searchParams.get("peekCycle") === cycleId) {
router.push(`${pathname}?${query}`);
} else {
router.push(`${pathname}?${query && `${query}&`}peekCycle=${cycleId}`);

View file

@ -113,7 +113,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
e.preventDefault();
const query = generateQueryParams(searchParams, ["peekModule"]);
if (searchParams.has("peekModule")) {
if (searchParams.has("peekModule") && searchParams.get("peekModule") === moduleId) {
router.push(`${pathname}?${query}`);
} else {
router.push(`${pathname}?${query && `${query}&`}peekModule=${moduleId}`);

View file

@ -67,7 +67,7 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
e.preventDefault();
const query = generateQueryParams(searchParams, ["peekModule"]);
if (searchParams.has("peekModule")) {
if (searchParams.has("peekModule") && searchParams.get("peekModule") === moduleId) {
router.push(`${pathname}?${query}`);
} else {
router.push(`${pathname}?${query && `${query}&`}peekModule=${moduleId}`);