Skip to content
1 change: 1 addition & 0 deletions src/apis/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ export const getAccessToken = async () => {
if (error instanceof Error) {
console.error(error.message)
}
throw new Error('토큰 재발급 실패')
}
}
2 changes: 1 addition & 1 deletion src/apis/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ client.interceptors.response.use(
return client(originalRequest)
} catch {
// 토큰 재발급 실패 시 로그아웃
if (window.confirm('토큰 재발급에 실패했습니다. 다시 로그인하시겠습니까?')) {
if (window.confirm('오류가 발생했습니다. 다시 로그인하시겠어요?')) {
useAuthStore.getState().logout()
window.location.href = '/login'
}
Expand Down
1 change: 0 additions & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const WITHDRAW_OPTIONS = [
'그 외 기타',
]

// TODO: 스토리지 변경
export const MAIN_BACKGROUND_IMAGE_BASE_LINK = 'https://storage.googleapis.com/to-hero/images/'

export const MAIN_BACKGROUND_IMAGE_LINK = [
Expand Down
8 changes: 4 additions & 4 deletions src/constants/key.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const SHARE_CODE_KEY = 'TH-SC-qa-6'
export const REFRESH_TOKEN_KEY = 'TH-RT-qa-6'
export const MEMBER_INFO_KEY = 'TH-MI-qa-6'
export const GUEST_INFO_KEY = 'TH-GI-qa-6'
export const SHARE_CODE_KEY = 'TH-SC-qa-7'
export const REFRESH_TOKEN_KEY = 'TH-RT-qa-7'
export const MEMBER_INFO_KEY = 'TH-MI-qa-7'
export const GUEST_INFO_KEY = 'TH-GI-qa-7'
2 changes: 1 addition & 1 deletion src/constants/write.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const MESSAGE_MAX_LENGTH = 100
export const MESSAGE_MAX_LENGTH = 300
export const WRITE_STEPS = [
'select-target',
'select-hero-type',
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Share/BuildingWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ interface BuildingWindowProps {

export default function BuildingWindow({ imgSrc, name }: BuildingWindowProps) {
return (
<article className="flex h-[121px] w-fit flex-col justify-between">
<article className="relative flex h-[121px] w-fit flex-col items-center justify-between">
{name !== null ? (
<>
<div className="relative h-auto w-[52px]">
<img src={imgSrc} alt="" className="absolute z-10" />
<BaseWindow className="text-brand-yellow drop-shadow-[0_0_40px_rgba(255,242,0,0.5)]" />
</div>
{name && (
<p className="label-small relative z-10 overflow-hidden text-ellipsis whitespace-nowrap rounded-full bg-neutral-90 px-2 py-1 text-white">
<p className="label-small absolute bottom-0 z-10 overflow-hidden text-ellipsis whitespace-nowrap rounded-full bg-neutral-90 px-2 py-1 text-white">
{name}
</p>
)}
Expand Down
4 changes: 3 additions & 1 deletion src/layouts/MetaTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet-async'
export default function MetaTag() {
return (
<Helmet>
<link rel="canonical" href="https://tohero.co.kr" />
<meta
name="description"
content="경찰관, 소방관 분들께 감사의 마음을 전하고 도시를 밝혀주세요"
Expand All @@ -20,8 +21,9 @@ export default function MetaTag() {
content="https://storage.googleapis.com/to-hero/images/site-image.png"
/>
<meta property="og:url" content="https://tohero.co.kr" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="To.Hero" />
<meta name="twitter:site" content="https://tohero.co.kr" />
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:description"
content="경찰관, 소방관 분들께 감사의 마음을 전하고 도시를 밝혀주세요"
Expand Down
13 changes: 10 additions & 3 deletions src/pages/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ export default function Main() {
const location = useLocation()
useBodyBackgroundColor('#14192F')

const { data: mainData } = useMainData()
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, refetch } = useGetMessages()
const { data: mainData, refetch: mainDataRefetch } = useMainData()
const {
data,
fetchNextPage,
hasNextPage,
isFetchingNextPage,
refetch: messagesRefetch,
} = useGetMessages()

const messages = data?.pages.flatMap((page) => page.openedLetters ?? []) ?? []

Expand All @@ -48,7 +54,8 @@ export default function Main() {

useEffect(() => {
if (location.state && location.state.from === 'write') {
refetch()
mainDataRefetch()
messagesRefetch()
}
}, [location])

Expand Down
2 changes: 1 addition & 1 deletion src/utils/extractImgLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const extractImgLink = (messageCount: number) => {
imgLink = MAIN_BACKGROUND_IMAGE_LINK[4]
} else if (messageCount < 750) {
imgLink = MAIN_BACKGROUND_IMAGE_LINK[5]
} else if (messageCount < 999) {
} else if (messageCount <= 999) {
imgLink = MAIN_BACKGROUND_IMAGE_LINK[6]
} else {
imgLink = MAIN_BACKGROUND_IMAGE_LINK[7]
Expand Down