Skip to content

Commit e843c11

Browse files
authored
Merge pull request #168 from YAPP-Github/feat/#167-qa-241207
feat: 1.0.6๋ฒ ํƒ€ QA ๋ฐ˜์˜
2 parents bfe5652 + 9384699 commit e843c11

File tree

24 files changed

+236
-201
lines changed

24 files changed

+236
-201
lines changed

โ€ŽProjects/App/ShareExtension/Sources/ShareRootFeature.swiftโ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ struct ShareRootFeature {
106106
func handleAsyncAction(_ action: Action.AsyncAction, state: inout State) -> Effect<Action> {
107107
switch action {
108108
case .URL_ํŒŒ์‹ฑ_์ˆ˜ํ–‰:
109-
guard let item = state.context?.inputItems.first as? NSExtensionItem,
110-
let itemProvider = item.attachments?.first else {
111-
return .none
112-
}
109+
guard
110+
let item = state.context?.inputItems.first as? NSExtensionItem,
111+
let itemProvider = item.attachments?.first
112+
else { return .none }
113113

114114
return .run { send in
115115
var urlItem: (any NSSecureCoding)? = nil

โ€ŽProjects/App/Sources/AppDelegate/AppDelegateFeature.swiftโ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public struct AppDelegateFeature {
6060
let setting = await self.userNotifications.getNotificationSettings()
6161
switch setting.authorizationStatus {
6262
case .authorized, .notDetermined:
63-
guard try await self.userNotifications.requestAuthorization([.alert, .sound])
63+
guard
64+
try await self.userNotifications.requestAuthorization([.alert, .sound])
6465
else { return }
6566
default: return
6667
}

โ€ŽProjects/App/Sources/MainTab/MainTabFeature.swiftโ€Ž

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct MainTabFeature {
4141
@Presents var contentDetail: ContentDetailFeature.State?
4242
@Shared(.inMemory("SelectCategory")) var categoryId: Int?
4343
@Shared(.inMemory("PushTapped")) var isPushTapped: Bool = false
44-
var savedContentId: Int?
44+
var categoryOfSavedContent: BaseCategoryItem?
4545

4646
public init() {
4747
self.pokit = .init()
@@ -78,6 +78,7 @@ public struct MainTabFeature {
7878
case ๊ฒฝ๊ณ _๋„์›€(BaseError)
7979
case errorSheetPresented(Bool)
8080
case ๋งํฌํŒ์—…_ํ™œ์„ฑํ™”(PokitLinkPopup.PopupType)
81+
case ์นดํ…Œ๊ณ ๋ฆฌ์ƒ์„ธ_์ด๋™(category: BaseCategoryItem)
8182
}
8283
public enum AsyncAction: Equatable {
8384
case ๊ณต์œ ๋ฐ›์€_์นดํ…Œ๊ณ ๋ฆฌ_์กฐํšŒ(categoryId: Int)
@@ -98,7 +99,7 @@ public struct MainTabFeature {
9899
switch action {
99100
case .binding(\.linkPopup):
100101
guard state.linkPopup == nil else { return .none }
101-
state.savedContentId = nil
102+
state.categoryOfSavedContent = nil
102103
return .none
103104
case .binding:
104105
return .none
@@ -183,15 +184,15 @@ private extension MainTabFeature {
183184
}
184185
)
185186
case .onOpenURL(url: let url):
186-
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
187-
return .none
188-
}
187+
guard
188+
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
189+
else { return .none }
189190

190191
let queryItems = components.queryItems ?? []
191-
guard let categoryIdString = queryItems.first(where: { $0.name == "categoryId" })?.value,
192-
let categoryId = Int(categoryIdString) else {
193-
return .none
194-
}
192+
guard
193+
let categoryIdString = queryItems.first(where: { $0.name == "categoryId" })?.value,
194+
let categoryId = Int(categoryIdString)
195+
else { return .none }
195196

196197
return .send(.async(.๊ณต์œ ๋ฐ›์€_์นดํ…Œ๊ณ ๋ฆฌ_์กฐํšŒ(categoryId: categoryId)))
197198
case .๊ฒฝ๊ณ _ํ™•์ธ๋ฒ„ํŠผ_ํด๋ฆญ:
@@ -222,7 +223,14 @@ private extension MainTabFeature {
222223
case let .๋งํฌํŒ์—…_ํ™œ์„ฑํ™”(type):
223224
state.linkPopup = type
224225
return .none
225-
226+
case let .์นดํ…Œ๊ณ ๋ฆฌ์ƒ์„ธ_์ด๋™(category):
227+
if category.categoryName == "๋ฏธ๋ถ„๋ฅ˜" {
228+
state.selectedTab = .pokit
229+
state.path.removeAll()
230+
return .send(.pokit(.delegate(.๋ฏธ๋ถ„๋ฅ˜_์นดํ…Œ๊ณ ๋ฆฌ_ํ™œ์„ฑํ™”)))
231+
}
232+
state.path.append(.์นดํ…Œ๊ณ ๋ฆฌ์ƒ์„ธ(.init(category: category)))
233+
return .none
226234
default: return .none
227235
}
228236
}
@@ -259,9 +267,9 @@ private extension MainTabFeature {
259267
return .send(.delegate(.๋งํฌ์ถ”๊ฐ€ํ•˜๊ธฐ))
260268
case .success:
261269
state.linkPopup = nil
262-
state.contentDetail = .init(contentId: state.savedContentId)
263-
state.savedContentId = nil
264-
return .none
270+
guard let category = state.categoryOfSavedContent else { return .none }
271+
state.categoryOfSavedContent = nil
272+
return .send(.inner(.์นดํ…Œ๊ณ ๋ฆฌ์ƒ์„ธ_์ด๋™(category: category)))
265273
case .error, .text, .warning, .none:
266274
return .none
267275
}

โ€ŽProjects/App/Sources/MainTab/MainTabPath.swiftโ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ public extension MainTabFeature {
141141
case .contentDetail(.presented(.delegate(.์ฆ๊ฒจ์ฐพ๊ธฐ_๊ฐฑ์‹ _์™„๋ฃŒ))),
142142
.contentDetail(.presented(.delegate(.์ปจํ…์ธ _์กฐํšŒ_์™„๋ฃŒ))),
143143
.contentDetail(.presented(.delegate(.์ปจํ…์ธ _์‚ญ์ œ_์™„๋ฃŒ))):
144-
guard let stackElementId = state.path.ids.last,
145-
let lastPath = state.path.last else {
144+
guard
145+
let stackElementId = state.path.ids.last,
146+
let lastPath = state.path.last
147+
else {
146148
switch state.selectedTab {
147149
case .pokit:
148150
return .send(.pokit(.delegate(.๋ฏธ๋ถ„๋ฅ˜_์นดํ…Œ๊ณ ๋ฆฌ_์ปจํ…์ธ _์กฐํšŒ)))
@@ -175,7 +177,7 @@ public extension MainTabFeature {
175177

176178
/// - ๋งํฌ์ถ”๊ฐ€ ๋ฐ ์ˆ˜์ •์—์„œ ์ €์žฅํ•˜๊ธฐ ๋ˆŒ๋ €์„ ๋•Œ
177179
case let .path(.element(stackElementId, action: .๋งํฌ์ถ”๊ฐ€๋ฐ์ˆ˜์ •(.delegate(.์ €์žฅํ•˜๊ธฐ_์™„๋ฃŒ(contentId))))):
178-
state.savedContentId = contentId
180+
state.categoryOfSavedContent = contentId
179181
state.path.removeLast()
180182
switch state.path.last {
181183
case .๊ฒ€์ƒ‰:

โ€ŽProjects/CoreKit/Sources/CoreNetwork/TokenInterceptor.swiftโ€Ž

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@ public final class TokenInterceptor: RequestInterceptor {
4444
dueTo error: Error,
4545
completion: @escaping (RetryResult) -> Void
4646
) {
47-
guard let response = request.task?.response as? HTTPURLResponse,
48-
response.statusCode == 401 else {
47+
guard
48+
let response = request.task?.response as? HTTPURLResponse,
49+
response.statusCode == 401
50+
else {
4951
completion(.doNotRetryWithError(error))
5052
return
5153
}
5254

5355
print("๐Ÿš€ Retry: statusCode: \(response.statusCode)")
5456

55-
guard keychain.read(.accessToken) != nil,
56-
let refreshToken = keychain.read(.refreshToken) else {
57+
guard
58+
keychain.read(.accessToken) != nil,
59+
let refreshToken = keychain.read(.refreshToken)
60+
else {
5761
deleteAllToken()
5862
completion(.doNotRetryWithError(error))
5963
return

โ€ŽProjects/CoreKit/Sources/Data/Client/KakaoSDK/Share/KakaoShareClient+LiveKey.swiftโ€Ž

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ extension KakaoShareClient: DependencyKey {
4545
buttons: [button]
4646
)
4747

48-
guard ShareApi.isKakaoTalkSharingAvailable(),
49-
let templateJsonData = try? SdkJSONEncoder.custom.encode(template),
50-
let templateJsonObject = SdkUtils.toJsonObject(templateJsonData) else {
48+
guard
49+
ShareApi.isKakaoTalkSharingAvailable(),
50+
let templateJsonData = try? SdkJSONEncoder.custom.encode(template),
51+
let templateJsonObject = SdkUtils.toJsonObject(templateJsonData)
52+
else {
5153
/// ๐Ÿšจ Error Case [1]: ์นด์นด์˜คํ†ก ๋ฏธ์„ค์น˜
52-
guard let url = URL(string: "itms-apps://itunes.apple.com/app/id362057947"),
53-
UIApplication.shared.canOpenURL(url) else {
54-
return
55-
}
54+
guard
55+
let url = URL(string: "itms-apps://itunes.apple.com/app/id362057947"),
56+
UIApplication.shared.canOpenURL(url)
57+
else { return }
5658

5759
UIApplication.shared.open(url, options: [:], completionHandler: nil)
5860
return

โ€ŽProjects/CoreKit/Sources/Data/Client/SocialLogin/Controller/AppleLoginController.swiftโ€Ž

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,28 @@ public final class AppleLoginController: NSObject, ASAuthorizationControllerDele
3333
controller: ASAuthorizationController,
3434
didCompleteWithAuthorization authorization: ASAuthorization
3535
) {
36-
guard let credential = authorization.credential as? ASAuthorizationAppleIDCredential else {
36+
guard
37+
let credential = authorization.credential as? ASAuthorizationAppleIDCredential
38+
else {
3739
continuation?.resume(throwing: SocialLoginError.invalidCredential)
3840
continuation = nil
3941
return
4042
}
4143

4244

43-
guard let tokenData = credential.identityToken,
44-
let token = String(data: tokenData, encoding: .utf8) else {
45+
guard
46+
let tokenData = credential.identityToken,
47+
let token = String(data: tokenData, encoding: .utf8)
48+
else {
4549
continuation?.resume(throwing: SocialLoginError.appleLoginError(.invalidIdentityToken))
4650
continuation = nil
4751
return
4852
}
4953

50-
guard let authorizationCode = credential.authorizationCode,
51-
let codeString = String(data: authorizationCode, encoding: .utf8) else {
54+
guard
55+
let authorizationCode = credential.authorizationCode,
56+
let codeString = String(data: authorizationCode, encoding: .utf8)
57+
else {
5258
continuation?.resume(throwing: SocialLoginError.appleLoginError(.invalidAuthorizationCode))
5359
continuation = nil
5460
return

โ€ŽProjects/DSKit/Sources/Components/PokitBadge.swiftโ€Ž

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,14 @@ public struct PokitBadge: View {
1919
.background {
2020
RoundedRectangle(cornerRadius: 4, style: .continuous)
2121
.fill(backgroundColor)
22-
.overlay {
23-
if state == .unRead {
24-
RoundedRectangle(cornerRadius: 4, style: .continuous)
25-
.stroke(.pokit(.border(.brand)), lineWidth: 1)
26-
}
27-
}
2822
}
2923
}
3024

3125
private var backgroundColor: Color {
3226
switch self.state {
3327
case .default, .small, .memo, .member: return .pokit(.bg(.primary))
3428
case .unCategorized: return .pokit(.color(.grayScale(._50)))
35-
case .unRead: return .pokit(.bg(.base))
29+
case .unRead: return Color(red: 1, green: 0.95, blue: 0.92)
3630
}
3731
}
3832

โ€ŽProjects/DSKit/Sources/Components/PokitCalendar.swiftโ€Ž

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ public struct PokitCalendar: View {
208208
let year = calendar.component(.year, from: date)
209209
let month = calendar.component(.month, from: date)
210210

211-
guard let range = calendar.range(
212-
of: .day,
213-
in: .month,
214-
for: date
215-
) else {
216-
return dates
217-
}
211+
guard
212+
let range = calendar.range(
213+
of: .day,
214+
in: .month,
215+
for: date
216+
)
217+
else { return dates }
218218

219219
dates = range.map { day in
220220
var components = DateComponents()
@@ -255,13 +255,13 @@ public struct PokitCalendar: View {
255255
return dates
256256
}
257257

258-
guard let monthRange = calendar.range(
259-
of: .day,
260-
in: .month,
261-
for: monthDate
262-
) else {
263-
return dates
264-
}
258+
guard
259+
let monthRange = calendar.range(
260+
of: .day,
261+
in: .month,
262+
for: monthDate
263+
)
264+
else { return dates }
265265

266266
let monthDays = Array(monthRange).suffix(firstWeekday - 1)
267267

@@ -369,25 +369,24 @@ public struct PokitCalendar: View {
369369
}
370370

371371
private func beforeButtonTapped() {
372-
guard let date = calendar.date(
373-
byAdding: .month,
374-
value: -1,
375-
to: currentDate
376-
) else {
377-
return
378-
}
372+
guard
373+
let date = calendar.date(
374+
byAdding: .month,
375+
value: -1,
376+
to: currentDate
377+
) else { return }
379378

380379
self.page = formatter.string(from: date)
381380
}
382381

383382
private func nextButtonTapped() {
384-
guard let date = calendar.date(
385-
byAdding: .month,
386-
value: 1,
387-
to: currentDate
388-
) else {
389-
return
390-
}
383+
guard
384+
let date = calendar.date(
385+
byAdding: .month,
386+
value: 1,
387+
to: currentDate
388+
)
389+
else { return }
391390

392391
self.page = formatter.string(from: date)
393392
}

โ€ŽProjects/DSKit/Sources/Components/PokitLinkCard.swiftโ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ public struct PokitLinkCard<Item: PokitLinkCardItem>: View {
135135
let isUnCategorized = link.categoryName == "๋ฏธ๋ถ„๋ฅ˜"
136136

137137
HStack(spacing: 6) {
138-
if let isRead = link.isRead, !isRead {
139-
PokitBadge(state: .unRead)
140-
}
141-
142138
PokitBadge(
143139
state: isUnCategorized
144140
? .unCategorized
145141
: .default(link.categoryName)
146142
)
147143

144+
if let isRead = link.isRead, !isRead {
145+
PokitBadge(state: .unRead)
146+
}
147+
148148
if let memo = link.memo, !memo.isEmpty {
149149
PokitBadge(state: .memo)
150150
}

0 commit comments

Comments
ย (0)