Skip to content

Commit d50d8e2

Browse files
BPerlakiHkelson42
authored andcommitted
Add Visibility for support donation
1 parent 64b2c49 commit d50d8e2

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ jobs:
6161
# https://developer.apple.com/help/account/reference/supported-capabilities-macos
6262
- name: Remove In App Purchase capability for macOS FTP (Developer ID signing)
6363
if: matrix.platform == 'macOS' && matrix.destination == 'ftp'
64-
run: sed -i '' '/in-app-payments/d' project.yml
64+
run: |
65+
sed -i '' '/in-app-payments/d' project.yml
66+
plutil -insert HIDE_DONATION -bool true Support/Info.plist
6567
6668
- name: Set VERSION from code
6769
shell: python

App/App_macOS.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ struct RootView: View {
196196
}
197197
.frame(minWidth: 160)
198198
.safeAreaInset(edge: .bottom) {
199-
if Payment.paymentButtonType() != nil && Brand.supportDonationVisible {
199+
if Payment.paymentButtonType() != nil && Brand.hideDonation != true {
200200
SupportKiwixButton {
201201
openWindow(id: "donation")
202202
}

Model/Brand.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ enum Brand {
5454
// currently only used by Kiwix brand
5555
// if this is missing from project.yml we fall back to true
5656
// and hide the support for donation (for macOS FTP)
57-
static let supportDonationVisible: Bool = Config.value(for: .supportDonationVisible) ?? false
57+
static let hideDonation: Bool = Config.value(for: .hideDonation) ?? false
5858

5959
static var defaultExternalLinkPolicy: ExternalLinkLoadingPolicy {
6060
guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy),
@@ -85,7 +85,7 @@ enum Config: String {
8585
case showSearchSnippetInSettings = "SETTINGS_SHOW_SEARCH_SNIPPET"
8686
case aboutText = "CUSTOM_ABOUT_TEXT"
8787
case aboutWebsite = "CUSTOM_ABOUT_WEBSITE"
88-
case supportDonationVisible = "SUPPORT_DONATION_VISIBLE"
88+
case hideDonation = "HIDE_DONATION"
8989

9090
static func value<T>(for key: Config) -> T? where T: LosslessStringConvertible {
9191
guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else {

project.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ targets:
106106
INFOPLIST_KEY_CFBundleDisplayName: Kiwix
107107
INFOPLIST_FILE: Support/Info.plist
108108
INFOPLIST_KEY_UILaunchStoryboardName: SplashScreenKiwix.storyboard
109-
SUPPORT_DONATION_VISIBLE: true # this line is removed for macOS FTP, where the donation pop up is hidden (not supported)
110109
sources:
111110
- path: Support
112111
excludes:

0 commit comments

Comments
 (0)