Skip to content

Commit

Permalink
doc: update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 5, 2024
1 parent e292e5b commit 0efb70d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 37 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,49 @@ struct SubscriptionView: View {
let privacyPolicy = URL(string: "https://wangchujiang.com/copybook-generator/privacy-policy.html")!
let termsOfService = URL(string: "https://wangchujiang.com/copybook-generator/terms-of-service.html")!
var body: some View {
if !subscriptions.products.isEmpty {
VStack {
SubscriptionStoreView(productIDs: subscriptions.productIDs)
.storeButton(.visible, for: .policies)
.subscriptionStorePolicyDestination(url: privacyPolicy, for: .privacyPolicy)
.subscriptionStorePolicyDestination(url: termsOfService, for: .termsOfService)
.onInAppPurchaseCompletion(perform: { product, result in
if case .success(.success(let transaction)) = result {
print("Purchased successfully: \(transaction.signedDate)")
await subscriptions.updatePurchasedProducts()
NavigationStack {
if !subscriptions.products.isEmpty {
VStack {
SubscriptionStoreView(productIDs: subscriptions.productIDs)
.storeButton(.visible, for: .policies)
.subscriptionStorePolicyDestination(url: privacyPolicy, for: .privacyPolicy)
.subscriptionStorePolicyDestination(url: termsOfService, for: .termsOfService)
.onInAppPurchaseCompletion(perform: { product, result in
if case .success(.success(let transaction)) = result {
print("Purchased successfully: \(transaction.signedDate)")
await subscriptions.updatePurchasedProducts()
dismiss()
} else {
print("Something else happened")
}
})
Button(action: {
Task {
await subscriptions.restorePurchases()
dismiss()
} else {
print("Something else happened")
}
}, label: {
Text("Restore Subscription")
})
Button(action: {
Task {
await subscriptions.restorePurchases()
dismiss()
#if os(macOS)
.buttonStyle(.link)
#endif
.offset(y: -22)
}
.background(.background)
.frame(minWidth: 320, minHeight: 580)
.frame(maxWidth: 450)
} else {
VStack {
if message.isEmpty {
ProgressView().progressViewStyle(.circular).scaleEffect(1).ignoresSafeArea(.all)
} else {
Text(message).foregroundStyle(.red)
}
}, label: {
Text("Restore Subscription")
})
#if os(macOS)
.buttonStyle(.link)
#endif
.offset(y: -22)
}
.background(.background)
.frame(minWidth: 320, minHeight: 580)
.frame(maxWidth: 450)
} else {
VStack {
if message.isEmpty {
ProgressView().progressViewStyle(.circular).scaleEffect(1).ignoresSafeArea(.all)
} else {
Text(message).foregroundStyle(.red)
}
.padding(.horizontal)
.frame(minWidth: 230, minHeight: 120)
}
.padding(.horizontal)
.frame(minWidth: 230, minHeight: 120)
}
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<p>
<a href="./README.zh.md">中文</a> •
<a href="#frequently-asked-questions">FAQ</a> •
<a target="_blank" href="https://wangchujiang.com/#/contact">Contact & Support</a>
<a target="_blank" href="https://wangchujiang.com/#/contact">Contact & Support</a> •
<a href="https://github.com/jaywcjlove/devtutor/releases">Changelog</a>
</p>
<p>
<a target="_blank" href="https://apps.apple.com/app/devtutor/id6471227008" title="DevTutor for SwiftUI AppStore"><img alt="DevTutor for SwiftUI AppStore" src="https://jaywcjlove.github.io/sb/download/macos.svg" height="51">
Expand Down
3 changes: 2 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<p>
<a href="./README.md">English</a> •
<a href="#常见问题解答">常见问题</a> •
<a target="_blank" href="https://wangchujiang.com/#/contact">联系&支持</a>
<a target="_blank" href="https://wangchujiang.com/#/contact">联系&支持</a> •
<a href="https://github.com/jaywcjlove/devtutor/releases">变更日志</a>
</p>
<p>
<a target="_blank" href="https://apps.apple.com/app/devtutor/id6471227008" title="DevTutor AppStore"><img alt="DevTutor AppStore" src="https://jaywcjlove.github.io/sb/download/macos.svg" height="51">
Expand Down

0 comments on commit 0efb70d

Please sign in to comment.