Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

feat: a replayed welcome tour brings the donate sheet too

Vojtěch Škopek7ddf0bf93d6f
diff --git a/tweak/Sources/App/Donate/Donate.h b/tweak/Sources/App/Donate/Donate.h
index 47ab750e..b6f3c12b 100644
--- a/tweak/Sources/App/Donate/Donate.h
+++ b/tweak/Sources/App/Donate/Donate.h
@@ -14,7 +14,7 @@ UIColor *SGKofiColor(void);
void SGShowDonateSheet(void);
SGModRow *SGDonateRow(void);
void SGWatchForDonate(void);
-// The first tour is done: the sheet follows it, or follows Home after the restart.
+// A tour is done: the sheet follows it, or follows Home after the restart.
void SGDonateAfterTour(BOOL restarting);
BOOL SGDonateAfterTourPending(void);
void SGOfferDonate(void);
diff --git a/tweak/Sources/App/Donate/Donate.m b/tweak/Sources/App/Donate/Donate.m
index e32e1258..40f743f3 100644
--- a/tweak/Sources/App/Donate/Donate.m
+++ b/tweak/Sources/App/Donate/Donate.m
@@ -478,11 +478,11 @@ SGModRow *SGDonateRow(void) {
return row;
}
-// Never over the tour, an alert or the update sheet, and never twice in one run: a busy screen
-// waits a couple of minutes, then the sheet is left for the next launch.
+// Never over the tour or an alert. On schedule it also stays out of an update-notice run and asks once
+// a run; after a tour, first or replayed from the Mod page, it always comes.
static void offerWhenClear(NSInteger tries) {
BOOL afterTour = SGDonateAfterTourPending();
- if (sg_offered || (!afterTour && now() < nextAsk()) || SGUpdateNoticeShown()) return;
+ if (!afterTour && (sg_offered || now() < nextAsk() || SGUpdateNoticeShown())) return;
UIViewController *top = SGTopController();
BOOL busy = !top || SGOnboardingShowing() || [top isKindOfClass:UIAlertController.class]
|| UIApplication.sharedApplication.applicationState != UIApplicationStateActive;
diff --git a/tweak/Sources/App/Onboarding/Tour.m b/tweak/Sources/App/Onboarding/Tour.m
index fc40fbcb..ba8d859e 100644
--- a/tweak/Sources/App/Onboarding/Tour.m
+++ b/tweak/Sources/App/Onboarding/Tour.m
@@ -315,7 +315,7 @@ static UIButton *glassButton(NSString *title) {
}
- (void)finish {
- if (!SGFlag(SGKeyOnboardingSeen, NO)) SGDonateAfterTour(self.needsRestart);
+ SGDonateAfterTour(self.needsRestart);
SGSetEnabled(SGKeyOnboardingSeen, YES);
SGSetRedesignedUI(_redesigned.selected);
if (self.needsRestart) {