From d494c68ae649c0b1d7bfbc66ad4d9952f1fece79 Mon Sep 17 00:00:00 2001 From: yshls Date: Wed, 28 Oct 2026 17:01:32 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat(map):=20=EC=B9=9C=EA=B5=AC=20=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=EB=A7=81=ED=81=AC=20=EC=9C=A0=ED=9A=A8=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EC=95=88=EB=82=B4=20toast=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/features/map/collaboration/ShareCollabButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/map/collaboration/ShareCollabButton.tsx b/src/features/map/collaboration/ShareCollabButton.tsx index 3771c9c6..72fc4d1e 100644 --- a/src/features/map/collaboration/ShareCollabButton.tsx +++ b/src/features/map/collaboration/ShareCollabButton.tsx @@ -53,7 +53,7 @@ export function ShareCollabButton() { navigator.clipboard.writeText(url).then(() => { setCopied(true); - toast.success('친구 초대 링크가 복사됐어요!', { description: '링크를 붙여넣어 친구에게 공유하세요.' }); + toast.success('친구 초대 링크가 복사됐어요!', { description: '이 링크는 24시간 동안 유지돼요. 붙여넣어 친구에게 공유하세요.' }); setTimeout(() => setCopied(false), 2500); }).catch(() => { // fallback: select text manually isn't possible here, just show the URL From 472cfc88c43c4a38802c3e12b4cc57b6f52dff99 Mon Sep 17 00:00:00 2001 From: yshls Date: Wed, 28 Oct 2026 17:04:42 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix(map):=20=EC=B9=9C=EA=B5=AC=20=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=EB=A7=81=ED=81=AC=20=EC=9C=A0=ED=9A=A8=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=2024h=20=E2=86=92=2072h=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/features/map/collaboration/ShareCollabButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/map/collaboration/ShareCollabButton.tsx b/src/features/map/collaboration/ShareCollabButton.tsx index 72fc4d1e..5be89c9f 100644 --- a/src/features/map/collaboration/ShareCollabButton.tsx +++ b/src/features/map/collaboration/ShareCollabButton.tsx @@ -53,7 +53,7 @@ export function ShareCollabButton() { navigator.clipboard.writeText(url).then(() => { setCopied(true); - toast.success('친구 초대 링크가 복사됐어요!', { description: '이 링크는 24시간 동안 유지돼요. 붙여넣어 친구에게 공유하세요.' }); + toast.success('친구 초대 링크가 복사됐어요!', { description: '이 링크는 72시간 동안 유지돼요. 붙여넣어 친구에게 공유하세요.' }); setTimeout(() => setCopied(false), 2500); }).catch(() => { // fallback: select text manually isn't possible here, just show the URL From 7569a4f4c78d7069bf85c689ab0999ff87c4087d Mon Sep 17 00:00:00 2001 From: yshls Date: Wed, 28 Oct 2026 17:09:31 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix(map):=20=EC=B9=9C=EA=B5=AC=20=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=E2=80=94=20=EA=B0=99=EC=9D=80=20=EB=B0=A9=EC=9D=B4?= =?UTF-8?q?=EB=A9=B4=20URL=20=EC=9E=AC=EC=82=AC=EC=9A=A9,=20=EC=83=88=20?= =?UTF-8?q?=EB=B0=A9=EC=9D=B4=EB=A9=B4=20URL=20=EA=B5=90=EC=B2=B4=20?= =?UTF-8?q?=ED=9B=84=20=EA=B3=B5=EC=9C=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이미 ?room= 있으면 현재 URL 그대로 복사 (핀 유지) - 없으면 새 UUID 생성 → router.replace로 URL 교체 → 복사 - 버튼 여러 번 눌러도 같은 방 공유됨 Co-Authored-By: Claude Sonnet 4.6 --- src/features/map/collaboration/ShareCollabButton.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/features/map/collaboration/ShareCollabButton.tsx b/src/features/map/collaboration/ShareCollabButton.tsx index 5be89c9f..56b3184a 100644 --- a/src/features/map/collaboration/ShareCollabButton.tsx +++ b/src/features/map/collaboration/ShareCollabButton.tsx @@ -1,6 +1,7 @@ 'use client'; import { useState } from 'react'; +import { useRouter } from 'next/navigation'; import styled from '@emotion/styled'; import { HugeiconsIcon } from '@hugeicons/react'; import { UserAdd01Icon, CheckmarkCircle01Icon } from '@hugeicons/core-free-icons'; @@ -43,20 +44,27 @@ const Btn = styled.button<{ $copied: boolean }>` export function ShareCollabButton() { const { isLoggedIn } = useAuth(); + const router = useRouter(); const [copied, setCopied] = useState(false); if (!isLoggedIn) return null; function handleShare() { - const roomId = crypto.randomUUID(); + // 이미 방에 있으면 현재 URL 재사용, 아니면 새 방 생성 후 URL 교체 + const params = new URLSearchParams(window.location.search); + const existingRoom = params.get('room'); + const roomId = existingRoom ?? crypto.randomUUID(); const url = `${window.location.origin}/map?room=${roomId}`; + if (!existingRoom) { + router.replace(`/map?room=${roomId}`); + } + navigator.clipboard.writeText(url).then(() => { setCopied(true); toast.success('친구 초대 링크가 복사됐어요!', { description: '이 링크는 72시간 동안 유지돼요. 붙여넣어 친구에게 공유하세요.' }); setTimeout(() => setCopied(false), 2500); }).catch(() => { - // fallback: select text manually isn't possible here, just show the URL toast.info('링크 복사 실패', { description: url }); }); }