Skip to content

Commit 793208a

Browse files
committed
[fix] #199 기본 썸네일 주소 변경
1 parent 69f0d3e commit 793208a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Projects/DSKit/Sources/Components/PokitLinkCard.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
175175
image
176176
.resizable()
177177
.aspectRatio(contentMode: .fill)
178-
} else if phase.error != nil {
179-
placeholder
180-
.onAppear { fetchMetaData?() }
181178
} else {
182179
placeholder
183180
}
@@ -186,6 +183,10 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
186183
.frame(width: 124, height: 94)
187184
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
188185
}
186+
.onCompletion { result in
187+
guard case .failure(_) = result else { return }
188+
fetchMetaData?()
189+
}
189190
}
190191

191192
private var divider: some View {

Projects/Feature/FeatureContentCard/Sources/ContentCard/ContentCardFeature.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ private extension ContentCardFeature {
148148
return .none
149149
}
150150
return .run { send in
151-
let imageURL = try await swiftSoupClient.parseOGImageURL(url)
152-
guard let imageURL else { return }
153-
await send(.inner(.메타데이터_조회_수행_반영(imageURL)))
151+
let imageURL = try? await swiftSoupClient.parseOGImageURL(url)
152+
await send(.inner(.메타데이터_조회_수행_반영(imageURL ?? Constants.기본_썸네일_주소.absoluteString)))
154153
}
155154
case .즐겨찾기_API:
156155
return .run { [id = state.content.id] send in

Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ private extension ContentSettingFeature {
253253
return .none
254254
case .메타데이터_조회_수행(url: let url):
255255
return .run { send in
256-
async let title = swiftSoup.parseOGTitle(url)
257-
async let imageURL = swiftSoup.parseOGImageURL(url)
258-
try await send(
256+
async let title = try? swiftSoup.parseOGTitle(url)
257+
async let imageURL = try? swiftSoup.parseOGImageURL(url)
258+
await send(
259259
.inner(.메타데이텨_조회_반영(title: title, imageURL: imageURL)),
260260
animation: .pokitDissolve
261261
)

Projects/Util/Sources/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public enum Constants {
2323
public static let 개인정보_처리방침_주소: URL = URL(string: "https://www.notion.so/de3468b3be1744538c22a333ae1d0ec8")!
2424
public static let 마케팅_정보_수신_주소: URL = URL(string: "https://www.notion.so/bb6d0d6569204d5e9a7b67e5825f9d10")!
2525
public static let 고객문의_주소: URL = URL(string: "https://www.instagram.com/pokit.official/")!
26-
public static let 기본_썸네일_주소: URL = URL(string: "https://pokit-storage.s3.ap-northeast-2.amazonaws.com/logo/pokit.png")!
26+
public static let 기본_썸네일_주소: URL = URL(string: "https://pokit-s3.s3.ap-northeast-2.amazonaws.com/logo/pokit.png")!
2727

2828
public static let 포킷_최대_갯수_문구: String = "최대 30개의 포킷을 생성할 수 있습니다.\n포킷을 삭제한 뒤에 추가해주세요."
2929
public static let 복사한_링크_저장하기_문구: String = "복사한 링크 저장하기"

0 commit comments

Comments
 (0)