Skip to content

Commit f16dc33

Browse files
committed
Fix delete confirm dialog
Fix Justify Fix revenuecat
1 parent f276431 commit f16dc33

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

App/Features/Entry/EntryView.swift

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ struct EntryView: View {
5050
}
5151
ToolbarItem(placement: toolbarPlacement) {
5252
FontSizeSelectorView()
53-
.buttonStyle(.plain)
5453
}
5554
ToolbarItem(placement: toolbarPlacement) {
5655
Menu(content: {
@@ -67,17 +66,14 @@ struct EntryView: View {
6766
})
6867
}
6968
}
70-
.actionSheet(isPresented: $showDeleteConfirm) {
71-
ActionSheet(
72-
title: Text("Confirm delete?"),
73-
buttons: [
74-
.destructive(Text("Delete")) {
75-
context.delete(entry)
76-
dismiss()
77-
},
78-
.cancel(),
79-
]
80-
)
69+
.alert("Confirm delete?", isPresented: $showDeleteConfirm) {
70+
Button(role: .destructive, action: {
71+
context.delete(entry)
72+
dismiss()
73+
}, label: {
74+
Text("Delete")
75+
})
76+
Button("Cancel", role: .cancel) {}
8177
}
8278
.sheet(isPresented: $showTag) {
8379
TagListFor(entry: entry)

App/Features/Entry/UI/FontSizeSelectorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct FontSizeSelectorView: View {
88
var body: some View {
99
HStack {
1010
Button(action: {
11-
withAnimation {
11+
withAnimation(.smooth) {
1212
showSelector = !showSelector
1313
}
1414
}, label: {

App/Features/Entry/WebView.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ import WebKit
2727
}
2828

2929
func webViewToLastPosition() {
30-
DispatchQueue.main.async {
31-
self.webView.wkWebView.scrollView.setContentOffset(CGPoint(x: 0.0, y: self.webView.entry.screenPositionForWebView), animated: true)
32-
}
30+
webView.wkWebView.scrollView.setContentOffset(
31+
CGPoint(
32+
x: 0.0,
33+
y: webView.entry.screenPositionForWebView
34+
),
35+
animated: true
36+
)
3337
}
3438

3539
func webView(_ webView: WKWebView, didFinish _: WKNavigation!) {
@@ -77,7 +81,7 @@ import WebKit
7781
func makeUIView(context: Context) -> WKWebView {
7882
wkWebView.navigationDelegate = context.coordinator
7983
wkWebView.scrollView.delegate = context.coordinator
80-
wkWebView.load(content: entry.content, justify: false)
84+
wkWebView.load(content: entry.content, justify: UserDefaults.standard.bool(forKey: "justifyArticle"))
8185

8286
return wkWebView
8387
}

App/Features/WallabagPlus/WallabagPlusStore.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import RevenueCat
44

55
@Observable
66
final class WallabagPlusStore {
7+
private let userDefaultKey = "REVENUECAT_SYNCED"
78
@ObservationIgnored @BundleKey("REVENUECAT_KEY")
89
private var revenueCatKey: String
910

@@ -14,6 +15,10 @@ final class WallabagPlusStore {
1415
}
1516

1617
func checkPro() async {
18+
if !UserDefaults.standard.bool(forKey: userDefaultKey) {
19+
_ = try? await Purchases.shared.syncPurchases()
20+
UserDefaults.standard.set(true, forKey: userDefaultKey)
21+
}
1722
proUnlocked = await (try? Purchases.shared.customerInfo(fetchPolicy: .fetchCurrent).entitlements.active.keys.contains("pro")) ?? false
1823
}
1924
}

SharedLib/Sources/SharedLib/Extension/WKWebView.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import WebKit
33

44
public extension WKWebView {
55
func load(content: String?, justify: Bool) {
6-
DispatchQueue.main.async { [weak self] in
7-
guard let content = self?.contentForWebView(content, justify: justify) else { return }
8-
self?.loadHTMLString(content, baseURL: Bundle.main.bundleURL)
9-
}
6+
guard let content = contentForWebView(content, justify: justify) else { return }
7+
loadHTMLString(content, baseURL: Bundle.main.bundleURL)
108
}
119

12-
func contentForWebView(_ content: String?, justify: Bool) -> String? {
10+
nonisolated func contentForWebView(_ content: String?, justify: Bool) -> String? {
1311
do {
1412
guard let content else { return nil }
1513
let html = try String(contentsOfFile: Bundle.main.path(forResource: "article", ofType: "html")!)

wallabag.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@
12701270
GCC_WARN_UNUSED_FUNCTION = YES;
12711271
GCC_WARN_UNUSED_VARIABLE = YES;
12721272
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
1273-
MARKETING_VERSION = 7.5.0;
1273+
MARKETING_VERSION = 7.5.2;
12741274
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
12751275
MTL_FAST_MATH = YES;
12761276
ONLY_ACTIVE_ARCH = YES;
@@ -1329,7 +1329,7 @@
13291329
GCC_WARN_UNUSED_FUNCTION = YES;
13301330
GCC_WARN_UNUSED_VARIABLE = YES;
13311331
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
1332-
MARKETING_VERSION = 7.5.0;
1332+
MARKETING_VERSION = 7.5.2;
13331333
MTL_ENABLE_DEBUG_INFO = NO;
13341334
MTL_FAST_MATH = YES;
13351335
SWIFT_COMPILATION_MODE = wholemodule;

0 commit comments

Comments
 (0)