Skip to content

Commit 8cd8d51

Browse files
authored
Merge pull request #96 from Nexters/fix/#95
[Fix/#95] 타로 리딩을 진행하지 않은 사용자에게도 결과 페이지에서 리뷰 모달이 표시되는 문제
2 parents ed2bcc0 + 2b6d7df commit 8cd8d51

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/tarot/components/TarotResultAfterView.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
"use client";
2-
import Image from "next/image";
3-
import styled from "styled-components";
4-
import PopularQuestions from "./PopularQuestion";
2+
import { SendChatMessageRequest } from "@/chat/apis/sendChatMessage";
53
import LinkIcon from "@/shared/assets/icons/link.svg";
64
import ColorStar from "@/shared/assets/icons/tarot-card-result-color-star.svg";
75
import Star from "@/shared/assets/icons/tarot-card-result-star.svg";
86
import CatWithCard from "@/shared/assets/images/cardWithCat.png";
9-
import NextRecommendQuestion from "./NextRecommendQuestion";
107
import Button from "@/shared/components/Button";
118
import Toast from "@/shared/components/Toast";
129
import { checkBrowserForWebShare } from "@/shared/utils/checkBrowserForWebShare";
1310
import shareLink from "@/shared/utils/shareLink";
1411
import { useTarotReadingResult } from "@/tarot/hooks/useTarotReadingResult";
1512
import findCardById from "@/tarot/utils/findCardById";
1613
import { useQueryClient } from "@tanstack/react-query";
17-
import { useParams, useRouter } from "next/navigation";
14+
import Image from "next/image";
15+
import { useParams, usePathname, useRouter } from "next/navigation";
1816
import { useEffect, useState } from "react";
19-
import { SendChatMessageRequest } from "@/chat/apis/sendChatMessage";
20-
import { usePathname } from "next/navigation";
17+
import styled from "styled-components";
2118
import { useTarotReviewExist } from "../hooks/useTarotReviewExist";
19+
import NextRecommendQuestion from "./NextRecommendQuestion";
20+
import PopularQuestions from "./PopularQuestion";
2221

23-
import TarotReadingReviewModal from "./TarotReadingReviewModal";
2422
import { useRef } from "react";
23+
import TarotReadingReviewModal from "./TarotReadingReviewModal";
2524
const TarotResultAfterView = () => {
2625
const { resultId, chatId } = useParams<{
2726
resultId: string;
@@ -73,7 +72,7 @@ const TarotResultAfterView = () => {
7372
const observer = new IntersectionObserver(
7473
(entries) => {
7574
if (entries[0].isIntersecting) {
76-
if (reviewExist !== undefined) {
75+
if (reviewExist !== undefined && data?.isOwner) {
7776
setReviewModalOpen(!reviewExist.hasReviewed);
7877
}
7978
observer.disconnect(); // 한 번 실행 후 감지 중지

0 commit comments

Comments
 (0)