From 8af1d3f13136f98fcd794562a67d464f1470229e Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 20 Mar 2020 15:52:11 -0700 Subject: [PATCH] Fixes incorrect action when refreshing/activating apps due to cell reuse --- AltStore/My Apps/MyAppsViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index e15cd242..85b9ebc0 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -286,6 +286,7 @@ private extension MyAppsViewController cell.bannerView.buttonLabel.text = NSLocalizedString("Expires in", comment: "") cell.bannerView.button.isIndicatingActivity = false + cell.bannerView.button.removeTarget(self, action: nil, for: .primaryActionTriggered) cell.bannerView.button.addTarget(self, action: #selector(MyAppsViewController.refreshApp(_:)), for: .primaryActionTriggered) let currentDate = Date() @@ -374,6 +375,7 @@ private extension MyAppsViewController cell.bannerView.button.isIndicatingActivity = false cell.bannerView.button.tintColor = tintColor cell.bannerView.button.setTitle(NSLocalizedString("ACTIVATE", comment: ""), for: .normal) + cell.bannerView.button.removeTarget(self, action: nil, for: .primaryActionTriggered) cell.bannerView.button.addTarget(self, action: #selector(MyAppsViewController.activateApp(_:)), for: .primaryActionTriggered) cell.bannerView.titleLabel.text = installedApp.name