Skip to content

Commit

Permalink
Refresh token on Appear (#2699)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1207023339673019/f

Description:

Refreshes the token when entering subscription settings
  • Loading branch information
afterxleep authored Apr 8, 2024
1 parent f0f1ac5 commit aa3b5f0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ final class SubscriptionRestoreViewModel: ObservableObject {
func onFirstAppear() async {
Pixel.fire(pixel: .privacyProSettingsAddDevice)
await setupTransactionObserver()
await refreshToken()
}

private func cleanUp() {
subFeature.cleanup()
cancellables.removeAll()
}


private func refreshToken() async {
if state.isAddingDevice {
await AppStoreAccountManagementFlow.refreshAuthTokenIfNeeded(subscriptionAppGroup: Bundle.main.appGroup(bundle: .subs))
}
}

private func setupContent() async {
if state.isAddingDevice {
Expand Down

0 comments on commit aa3b5f0

Please sign in to comment.