Skip to content

Commit

Permalink
Hides Patreon external link for APP_STORE and LEGACY builds to appeas…
Browse files Browse the repository at this point in the history
…e App Review

🙄
  • Loading branch information
rileytestut committed Jul 10, 2024
1 parent ffbd500 commit d4f48ea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
34 changes: 17 additions & 17 deletions Delta/Base.lproj/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -765,24 +765,8 @@ Menu + Long-Press: Quick Load</string>
</tableViewSection>
<tableViewSection headerTitle="Patreon" footerTitle="Support future development and receive early access to new features by becoming a patron." id="QvT-Yt-oP1">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" textLabel="faT-qa-JP0" style="IBUITableViewCellStyleDefault" id="4it-3L-j8P">
<rect key="frame" x="16" y="2502" width="343" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="4it-3L-j8P" id="7dE-36-hzp">
<rect key="frame" x="0.0" y="0.0" width="316.5" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Join our Patreon" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="faT-qa-JP0">
<rect key="frame" x="16" y="0.0" width="292.5" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="gray" indentationWidth="10" reuseIdentifier="ActivityCell" id="sXq-X7-zis">
<rect key="frame" x="16" y="2546" width="343" height="44"/>
<rect key="frame" x="16" y="2502" width="343" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="sXq-X7-zis" id="Gin-0e-sAA">
<rect key="frame" x="0.0" y="0.0" width="343" height="44"/>
Expand All @@ -808,6 +792,22 @@ Menu + Long-Press: Quick Load</string>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Cell" textLabel="faT-qa-JP0" style="IBUITableViewCellStyleDefault" id="4it-3L-j8P">
<rect key="frame" x="16" y="2546" width="343" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="4it-3L-j8P" id="7dE-36-hzp">
<rect key="frame" x="0.0" y="0.0" width="316.5" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Join our Patreon" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="faT-qa-JP0">
<rect key="frame" x="16" y="0.0" width="292.5" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Credits" footerTitle="Follow Riley and Shane on Threads for all the latest Delta news. Tap a name to view their profile." id="foh-L9-g6W">
Expand Down
28 changes: 17 additions & 11 deletions Delta/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ private extension SettingsViewController

enum PatreonRow: Int, CaseIterable
{
case joinPatreon
case connectAccount
case joinPatreon
}

enum CreditsRow: Int, CaseIterable
Expand Down Expand Up @@ -652,6 +652,12 @@ extension SettingsViewController
return 1
}

#if APP_STORE || LEGACY
case .patreon:
// Don't link out to Patreon for APP_STORE or LEGACY builds.
return 1
#endif

default:
if isSectionHidden(section)
{
Expand Down Expand Up @@ -708,16 +714,6 @@ extension SettingsViewController
let row = PatreonRow(rawValue: indexPath.row)!
switch row
{
case .joinPatreon:
if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron
{
cell.textLabel?.text = NSLocalizedString("View Patreon", comment: "")
}
else
{
cell.textLabel?.text = NSLocalizedString("Join our Patreon", comment: "")
}

case .connectAccount:
var content = cell.defaultContentConfiguration()
content.textProperties.color = .deltaPurple
Expand All @@ -733,6 +729,16 @@ extension SettingsViewController
}

cell.contentConfiguration = content

case .joinPatreon:
if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron
{
cell.textLabel?.text = NSLocalizedString("View Patreon", comment: "")
}
else
{
cell.textLabel?.text = NSLocalizedString("Join our Patreon", comment: "")
}
}

case .controllerOpacity, .display, .gameAudio, .multitasking, .hapticFeedback, .gestures, .airPlay, .hapticTouch, .advanced, .credits, .support: break
Expand Down

0 comments on commit d4f48ea

Please sign in to comment.