Skip to content

Commit

Permalink
Fixed bug with restore purchases
Browse files Browse the repository at this point in the history
  • Loading branch information
leathalman committed May 28, 2022
1 parent ffa871e commit cc656ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Binary file not shown.
10 changes: 5 additions & 5 deletions Jotify/Controller/PageBoyController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ class PageBoyController: PageboyViewController, PageboyViewControllerDataSource
//enable and disable swipe via notification from child view controllers
NotificationCenter.default.addObserver(self, selector: #selector(enableSwipe(notification:)), name:NSNotification.Name(rawValue: "enableSwipe"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(disableSwipe(notification:)), name:NSNotification.Name(rawValue: "disableSwipe"), object: nil)

if User.settings?.hasPremium == false {
checkForRestorePurchase()
}
}

@objc func disableSwipe(notification: Notification){
Expand All @@ -97,11 +93,15 @@ class PageBoyController: PageboyViewController, PageboyViewControllerDataSource
if success! {
User.settings = settings

if User.settings?.referralLink == "" {
if settings?.referralLink == "" {
print("created new referral link")
ReferralManager().createReferralLink()
}

if !(settings?.hasPremium ?? false) {
self.checkForRestorePurchase()
}

//check to see if they should get premium from referrals
if !(settings?.hasPremium ?? false) {
if settings?.referrals ?? 0 >= 3 {
Expand Down

0 comments on commit cc656ec

Please sign in to comment.