Compare commits
No commits in common. "ec767542705075b34977ecc8c6ac208998b784f4" and "281585cdf07adc3dbc5fc73f1cbbd8b87d987d1f" have entirely different histories.
ec76754270
...
281585cdf0
|
@ -1,9 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 2024.1 (119)
|
|
||||||
Features/Improvements:
|
|
||||||
- Add Account Settings button to Preferences
|
|
||||||
|
|
||||||
## 2024.1 (118)
|
## 2024.1 (118)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Fix music not pausing/resuming when video playback starts
|
- Fix music not pausing/resuming when video playback starts
|
||||||
|
|
|
@ -9,17 +9,12 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UserAccounts
|
import UserAccounts
|
||||||
import SafariServices
|
|
||||||
|
|
||||||
class PreferencesNavigationController: UINavigationController {
|
class PreferencesNavigationController: UINavigationController {
|
||||||
|
|
||||||
private let mastodonController: MastodonController
|
|
||||||
|
|
||||||
private var isSwitchingAccounts = false
|
private var isSwitchingAccounts = false
|
||||||
|
|
||||||
init(mastodonController: MastodonController) {
|
init(mastodonController: MastodonController) {
|
||||||
self.mastodonController = mastodonController
|
|
||||||
|
|
||||||
let view = PreferencesView(mastodonController: mastodonController)
|
let view = PreferencesView(mastodonController: mastodonController)
|
||||||
let hostingController = UIHostingController(rootView: view)
|
let hostingController = UIHostingController(rootView: view)
|
||||||
super.init(rootViewController: hostingController)
|
super.init(rootViewController: hostingController)
|
||||||
|
@ -36,7 +31,6 @@ class PreferencesNavigationController: UINavigationController {
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(showAddAccount), name: .addAccount, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(showAddAccount), name: .addAccount, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(activateAccount(_:)), name: .activateAccount, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(activateAccount(_:)), name: .activateAccount, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(userLoggedOut), name: .userLoggedOut, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(userLoggedOut), name: .userLoggedOut, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(showMastodonSettings), name: .showMastodonSettings, object: nil)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillDisappear(_ animated: Bool) {
|
override func viewWillDisappear(_ animated: Bool) {
|
||||||
|
@ -99,13 +93,6 @@ class PreferencesNavigationController: UINavigationController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func showMastodonSettings() {
|
|
||||||
var components = URLComponents(url: mastodonController.accountInfo!.instanceURL, resolvingAgainstBaseURL: false)!
|
|
||||||
components.path = "/auth/edit"
|
|
||||||
let vc = SFSafariViewController(url: components.url!)
|
|
||||||
present(vc, animated: true)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension PreferencesNavigationController: OnboardingViewControllerDelegate {
|
extension PreferencesNavigationController: OnboardingViewControllerDelegate {
|
||||||
|
|
|
@ -80,22 +80,15 @@ struct PreferencesView: View {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
NotificationCenter.default.post(name: .addAccount, object: nil)
|
NotificationCenter.default.post(name: .addAccount, object: nil)
|
||||||
}) {
|
}) {
|
||||||
Text("Add Account…")
|
Text("Add Account...")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(action: {
|
Button(action: {
|
||||||
self.showingLogoutConfirmation = true
|
self.showingLogoutConfirmation = true
|
||||||
}) {
|
}) {
|
||||||
Text("Logout from Current…")
|
Text("Logout from current")
|
||||||
}.alert(isPresented: $showingLogoutConfirmation) {
|
}.alert(isPresented: $showingLogoutConfirmation) {
|
||||||
Alert(title: Text("Are you sure you want to logout?"), message: nil, primaryButton: .destructive(Text("Logout"), action: self.logoutPressed), secondaryButton: .cancel())
|
Alert(title: Text("Are you sure you want to logout?"), message: nil, primaryButton: .destructive(Text("Logout"), action: self.logoutPressed), secondaryButton: .cancel())
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
|
||||||
NotificationCenter.default.post(name: .showMastodonSettings, object: nil)
|
|
||||||
} label: {
|
|
||||||
Text("Account Settings")
|
|
||||||
}
|
|
||||||
} header: {
|
} header: {
|
||||||
Text("Accounts")
|
Text("Accounts")
|
||||||
}
|
}
|
||||||
|
@ -146,10 +139,6 @@ struct PreferencesView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Notification.Name {
|
|
||||||
static let showMastodonSettings = Notification.Name("Tusker.showMastodonSettings")
|
|
||||||
}
|
|
||||||
|
|
||||||
//#if DEBUG
|
//#if DEBUG
|
||||||
//struct PreferencesView_Previews : PreviewProvider {
|
//struct PreferencesView_Previews : PreviewProvider {
|
||||||
// static var previews: some View {
|
// static var previews: some View {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// https://help.apple.com/xcode/#/dev745c5c974
|
// https://help.apple.com/xcode/#/dev745c5c974
|
||||||
|
|
||||||
MARKETING_VERSION = 2024.1
|
MARKETING_VERSION = 2024.1
|
||||||
CURRENT_PROJECT_VERSION = 119
|
CURRENT_PROJECT_VERSION = 118
|
||||||
CURRENT_PROJECT_VERSION = $(inherited)$(CURRENT_PROJECT_VERSION_BUILD_SUFFIX_$(CONFIGURATION))
|
CURRENT_PROJECT_VERSION = $(inherited)$(CURRENT_PROJECT_VERSION_BUILD_SUFFIX_$(CONFIGURATION))
|
||||||
|
|
||||||
CURRENT_PROJECT_VERSION_BUILD_SUFFIX_Debug=-dev
|
CURRENT_PROJECT_VERSION_BUILD_SUFFIX_Debug=-dev
|
||||||
|
|
Loading…
Reference in New Issue