Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/pages/main/node/[placeId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import { useUserStatus } from '@/shared/hooks/useUserStatus';
import { useStampAcquire } from '@/shared/api/main/node/queries/useStampAcquire';
import { savePostcard } from '@/shared/utils/storage';
import { Skeleton } from '@/shared/components/skeleton/Skeleton';
import { useQueryClient } from '@tanstack/react-query';

const Node = () => {
const router = useRouter();
const { placeId } = router.query;
const [showLoginPopup, setShowLoginPopup] = useState(false);
const [showErrorPopup, setShowErrorPopup] = useState(false);
const { isLoggedIn } = useUserStatus();
const queryClient = useQueryClient();

// ์ด๋ฏธ์ง€ ๋กœ๋”ฉ ์ƒํƒœ
const [imageLoaded, setImageLoaded] = useState(false);
Expand Down Expand Up @@ -67,6 +69,7 @@ const Node = () => {
const { isCompleted, imageUrl, placeName, description, address } = data.data;

// ๐Ÿ”น ์Šคํƒฌํ”„ ์ฐ๊ธฐ ๋ฒ„ํŠผ

const handleStampClick = () => {
if (!isLoggedIn) {
setShowLoginPopup(true);
Expand All @@ -78,11 +81,8 @@ const Node = () => {
getLocation(
(pos) => {
const body = {
latitude: 37.52146604044732,
latitude: 37.52146604044732,
longitude: 126.76740151260397,
// ์‹ค์ œ ์œ„์น˜ ์‚ฌ์šฉ ์‹œ:
// latitude: pos.coords.latitude,
// longitude: pos.coords.longitude,
};
Comment on lines 81 to 86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐Ÿ”ด Critical

ํ•˜๋“œ์ฝ”๋”ฉ๋œ ์ขŒํ‘œ๋กœ ์ธํ•ด ์œ„์น˜ ๊ธฐ๋ฐ˜ ๊ฒ€์ฆ์ด ์šฐํšŒ๋ฉ๋‹ˆ๋‹ค.

getLocation()์„ ํ˜ธ์ถœํ•˜์—ฌ ์‚ฌ์šฉ์ž์˜ ์‹ค์ œ ์œ„์น˜๋ฅผ ๋ฐ›์•„์˜ค์ง€๋งŒ, ๋ฐ›์€ pos ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ํ•˜๋“œ์ฝ”๋”ฉ๋œ ์ขŒํ‘œ๋ฅผ ์ „์†กํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด:

  • ์œ„์น˜ ๊ธฐ๋ฐ˜ ์Šคํƒฌํ”„ ํš๋“ ๊ฒ€์ฆ์ด ์™„์ „ํžˆ ๋ฌด๋ ฅํ™”๋ฉ๋‹ˆ๋‹ค
  • ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ถˆํ•„์š”ํ•˜๊ฒŒ ์œ„์น˜ ๊ถŒํ•œ์„ ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค
  • ํ…Œ์ŠคํŠธ/๋””๋ฒ„๊ทธ ์ฝ”๋“œ๊ฐ€ ํ”„๋กœ๋•์…˜์— ๋จธ์ง€๋  ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค

์ด๊ฒƒ์ด ์˜๋„๋œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ์ธ์ง€ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ํ”„๋กœ๋•์…˜์— ๋ฐฐํฌํ•  ๊ฒฝ์šฐ, ์‹ค์ œ ์‚ฌ์šฉ์ž ์œ„์น˜๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค:

 const body = {
-  latitude: 37.52146604044732,
-  longitude: 126.76740151260397,
+  latitude: pos.coords.latitude,
+  longitude: pos.coords.longitude,
 };

๋˜๋Š” ํ…Œ์ŠคํŠธ ๋ชฉ์ ์ด๋ผ๋ฉด, ๋ณ„๋„์˜ feature flag๋‚˜ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋กœ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

๐Ÿค– Prompt for AI Agents
In src/pages/main/node/[placeId].tsx around lines 81 to 86, the callback to
getLocation ignores the received pos and sends hardcoded coordinates which
bypasses location-based validation; replace the hardcoded latitude/longitude
with the actual pos values (e.g., pos.coords.latitude and pos.coords.longitude)
so the app uses the userโ€™s real location, and if those literal coordinates were
left for testing wrap the behavior behind a feature flag or environment variable
(or remove before prod); confirm intent and ensure location-permission flow and
error handling remain correct when using pos.

const placeIdNum = Number(placeId);

Expand All @@ -91,6 +91,9 @@ const Node = () => {
{
onSuccess: (res) => {
const { postcard } = res.data;

queryClient.invalidateQueries({ queryKey: ['stampStatus'] });

savePostcard(postcard);

router.push({
Expand Down
Loading