@uniai-fe/uds-templates 0.4.27 → 0.4.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-templates",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "UNIAI Design System; UI Templates Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -23,6 +23,16 @@ export default function useWeatherKorea() {
23
23
  useEffect(() => {
24
24
  if (typeof window === "undefined") return;
25
25
 
26
+ const hasInjectedCoordinate =
27
+ typeof coordinate.address === "string" ||
28
+ coordinate.lat !== null ||
29
+ coordinate.lng !== null;
30
+
31
+ if (!hasInjectedCoordinate) {
32
+ // 변경 설명: 초기 mount에서 coordinate 주입 전에는 geolocation/web API 준비를 시도하지 않는다.
33
+ return;
34
+ }
35
+
26
36
  const nowMoments = getWeatherBaseMoments("now");
27
37
  const forecastMoments = getWeatherBaseMoments("forecast");
28
38
 
@@ -120,12 +120,15 @@ export async function getWeatherGridLocation(
120
120
  latitude: coordinate?.lat ?? null,
121
121
  longitude: coordinate?.lng ?? null,
122
122
  };
123
+ const hasInjectedAddress =
124
+ typeof coordinate?.address === "string" && coordinate.address.trim() !== "";
123
125
 
124
126
  // console.log("[getWeatherLocation] 특정 좌표지정 확인", coordinate);
125
127
 
126
- // 특정 위경도 좌표를 받지 못하는 경우, 현재 사용자 위치로 지정
128
+ // 변경 설명: 서비스가 address만 명시적으로 주입한 경우에는 geolocation fallback을 재시도하지 않는다.
127
129
  if (
128
130
  typeof window !== "undefined" &&
131
+ !hasInjectedAddress &&
129
132
  (typeof coordinate === "undefined" ||
130
133
  geo.latitude === null ||
131
134
  geo.longitude === null)