Skip to content

Commit

Permalink
fix issue with showing setup incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Sep 18, 2024
1 parent 6a3f5ea commit 3a59685
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion HabitRPG/UI/Login/LoginViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class LoginViewModel: LoginViewModelType, LoginViewModelInputs, LoginViewModelOu
passwordText = self.prefillPasswordProperty.signal
passwordRepeatText = self.prefillPasswordRepeatProperty.signal

showNextViewController = onSuccessfulLoginProperty.signal.combineLatest(with: authTypeProperty.signal)
showNextViewController = onSuccessfulLoginProperty.signal.withLatest(from: authTypeProperty.signal)
.map({ (isNewUser, authType) -> String in
if authType == .login && !isNewUser {
return "MainSegue"
Expand Down
2 changes: 1 addition & 1 deletion HabitRPG/UI/Purchases/GiftSubscriptionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class GiftSubscriptionViewController: UIHostingController<GiftSubscriptionPage>
let alertController = HabiticaAlertController(title: L10n.giftConfirmationTitle, message: body)
alertController.addCloseAction { _ in
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()+1) {
self.performSegue(withIdentifier: "unwindToList", sender: self)
self.dismiss()
}
}
alertController.show()
Expand Down
2 changes: 1 addition & 1 deletion HabitRPG/Utilities/NotificationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class NotificationManager {

static func displayLoginIncentive(notification: NotificationProtocol) -> Bool {
guard let loginIncentiveNotification = notification as? NotificationLoginIncentiveProtocol else {
return false
return true
}
let nextRewardAt = loginIncentiveNotification.nextRewardAt
userRepository.retrieveUser().observeValues { user in
Expand Down
19 changes: 11 additions & 8 deletions HabitRPG/Utilities/SoundManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,20 @@ class SoundManager {
if currentTheme == SoundTheme.none {
return
}
guard let url = soundsDirectory?.appendingPathComponent("\(currentTheme.rawValue)/\(effect.rawValue).mp3") else {
return
}

if !FileManager.default.fileExists(atPath: url.path) {
return
}

let queue = DispatchQueue(label: "sound", attributes: .concurrent)
queue.async {[weak self] in
do {
guard let theme = self?.currentTheme.rawValue else {
return
}
guard let url = self?.soundsDirectory?.appendingPathComponent("\(theme)/\(effect.rawValue).mp3") else {
return
}

if !FileManager.default.fileExists(atPath: url.path) {
return
}

try AVAudioSession.sharedInstance().setCategory(.ambient, mode: .default)
try AVAudioSession.sharedInstance().setActive(true)
self?.player = try? AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.mp3.rawValue)
Expand Down
1 change: 1 addition & 0 deletions HabitRPG/Views/GroupInvitationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class GroupInvitationListView: UIView {
let view = GroupInvitationView()
view.set(invitation: invitation)
view.responseAction = {[weak self] didAccept in
if !invitation.isValid { return }
guard let groupID = invitation.id else {
return
}
Expand Down

0 comments on commit 3a59685

Please sign in to comment.