Skip to content

Commit

Permalink
Merge pull request #42 from Async-Swift/Stamp/checkStamp
Browse files Browse the repository at this point in the history
[HotFix] 앱 재시동후 Stamp가 보이지 않은 문제
  • Loading branch information
unnnyong authored Sep 20, 2022
2 parents e6d17f4 + 95d03a3 commit 871da27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
11 changes: 0 additions & 11 deletions .well-known/apple-app-site-association

This file was deleted.

16 changes: 9 additions & 7 deletions AsyncSwift/Observed/AppData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ final class AppData: ObservableObject {
@Published var currentTab: Tab = .event

private var currentStamp: Stamp?
lazy var isStampExist: Bool = {
KeyChain.shared.getItem(key: currentStamp?.title) != nil
}()
var isStampExist: Bool {
if currentStamp == nil {
fetchCurrentStamp()
}

return KeyChain.shared.getItem(key: currentStamp?.title) != nil
}

init(){
fetchCurrentStamp()
}

func checkLink(url: URL) -> Bool {
// URL Example = https://asyncswift.info?tab=stamp
// URL Example = https://asyncswift.info?tab=event
// URL Example = https://asyncswift.info?tab=Stamp
// URL Example = https://asyncswift.info?tab=Event
guard URLComponents(url: url, resolvingAgainstBaseURL: true)?.host != nil else { return false }
print(url)
var queries = [String: String]()
for item in URLComponents(url: url, resolvingAgainstBaseURL: true)?.queryItems ?? [] {
queries[item.name] = item.value
Expand All @@ -36,7 +39,6 @@ final class AppData: ObservableObject {
switch queries["tab"] {
case Tab.stamp.rawValue:
KeyChain.shared.addItem(key: currentStampName, pwd: "true") ? print("Adding Stamp History KeyChain is Success") : print("Adding Stamp History is Fail")
self.isStampExist = true
currentTab = .stamp
case Tab.event.rawValue:
currentTab = .event
Expand Down
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

0 comments on commit 871da27

Please sign in to comment.