fix: [PWT-169] 사전 등록 > 기기 체크 없이 스토브 앱 다운로드 버튼 노출되는 현상 문의
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* @description gameData, pageData 처리에 필요한 유틸리티 함수를 제공합니다.
|
||||
*/
|
||||
|
||||
import type { PlatformType } from '#layers/types/api/gameData'
|
||||
import type { OsType, PlatformType } from '#layers/types/api/gameData'
|
||||
import type {
|
||||
PageDataValue,
|
||||
PageDataResourceContainer,
|
||||
@@ -23,12 +23,10 @@ const OS_TYPE_MAP: Record<string, string[]> = {
|
||||
* OS 타입에 따라 가능한 플랫폼 목록을 반환합니다.
|
||||
*/
|
||||
export const getSupportedPlatforms = (
|
||||
osType: string | number,
|
||||
options?: { platformType?: PlatformType }
|
||||
osType: OsType,
|
||||
platformType: PlatformType
|
||||
): string[] => {
|
||||
const type = String(osType)
|
||||
const platformType = String(options?.platformType ?? '0')
|
||||
const storePlatforms = OS_TYPE_MAP[type] ?? []
|
||||
const storePlatforms = OS_TYPE_MAP[osType] ?? []
|
||||
|
||||
switch (platformType) {
|
||||
case '1': // PC 전용
|
||||
@@ -37,11 +35,9 @@ export const getSupportedPlatforms = (
|
||||
case '2': // 모바일 스토어 전용
|
||||
return storePlatforms
|
||||
|
||||
default:
|
||||
case '3': // PC + 모바일 스토어 모두
|
||||
return ['pc', ...storePlatforms]
|
||||
|
||||
default: // 기본: OS_TYPE_MAP
|
||||
return storePlatforms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,15 +45,6 @@ export const formatPathWithoutLocale = (path: string): string => {
|
||||
return path.replace(/^\/[a-z]{2}(?=\/|$)/, '') || '/'
|
||||
}
|
||||
|
||||
/**
|
||||
* URL이 내부 링크인지 확인합니다.
|
||||
* @param url 확인할 URL
|
||||
* @returns 내부 링크 여부
|
||||
*/
|
||||
export const isInternalUrl = (url?: string): boolean => {
|
||||
return !!url && !url.startsWith('http')
|
||||
}
|
||||
|
||||
/**
|
||||
* 리소스 경로를 완전한 호스트 URL로 변환합니다.
|
||||
* @param path 리소스 경로
|
||||
|
||||
Reference in New Issue
Block a user