mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Merge pull request #673 from 0-Blu/develop
Added more feedback options.
This commit is contained in:
@@ -541,7 +541,7 @@ extension SettingsViewController
|
|||||||
switch section
|
switch section
|
||||||
{
|
{
|
||||||
case .signIn where self.activeTeam != nil: return 1.0
|
case .signIn where self.activeTeam != nil: return 1.0
|
||||||
case .account where self.activeTeam == nil: return 1.0
|
case .account where self.activeTeam == nil: return 1.0
|
||||||
case .signIn, .patreon, .appRefresh:
|
case .signIn, .patreon, .appRefresh:
|
||||||
let height = self.preferredHeight(for: self.prototypeHeaderFooterView, in: section, isHeader: false)
|
let height = self.preferredHeight(for: self.prototypeHeaderFooterView, in: section, isHeader: false)
|
||||||
return height
|
return height
|
||||||
@@ -587,29 +587,58 @@ extension SettingsViewController
|
|||||||
switch row
|
switch row
|
||||||
{
|
{
|
||||||
case .sendFeedback:
|
case .sendFeedback:
|
||||||
if MFMailComposeViewController.canSendMail()
|
let alertController = UIAlertController(title: "Send Feedback", message: "Choose a method to send feedback:", preferredStyle: .actionSheet)
|
||||||
{
|
|
||||||
let mailViewController = MFMailComposeViewController()
|
// Option 1: GitHub
|
||||||
mailViewController.mailComposeDelegate = self
|
alertController.addAction(UIAlertAction(title: "GitHub", style: .default) { _ in
|
||||||
mailViewController.setToRecipients(["support@sidestore.io"])
|
if let githubURL = URL(string: "https://github.com/SideStore/SideStore/issues") {
|
||||||
|
let safariViewController = SFSafariViewController(url: githubURL)
|
||||||
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
safariViewController.preferredControlTintColor = .altPrimary
|
||||||
{
|
self.present(safariViewController, animated: true, completion: nil)
|
||||||
mailViewController.setSubject("SideStore Beta \(version) Feedback")
|
|
||||||
}
|
}
|
||||||
else
|
})
|
||||||
{
|
|
||||||
mailViewController.setSubject("SideStore Beta Feedback")
|
// Option 2: Discord
|
||||||
|
alertController.addAction(UIAlertAction(title: "Discord", style: .default) { _ in
|
||||||
|
if let discordURL = URL(string: "https://discord.gg/sidestore-949183273383395328") {
|
||||||
|
let safariViewController = SFSafariViewController(url: discordURL)
|
||||||
|
safariViewController.preferredControlTintColor = .altPrimary
|
||||||
|
self.present(safariViewController, animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
self.present(mailViewController, animated: true, completion: nil)
|
|
||||||
}
|
// Option 3: Mail
|
||||||
else
|
// alertController.addAction(UIAlertAction(title: "Send Email", style: .default) { _ in
|
||||||
{
|
// if MFMailComposeViewController.canSendMail() {
|
||||||
let toastView = ToastView(text: NSLocalizedString("Cannot Send Mail", comment: ""), detailText: nil)
|
// let mailViewController = MFMailComposeViewController()
|
||||||
toastView.show(in: self)
|
// mailViewController.mailComposeDelegate = self
|
||||||
|
// mailViewController.setToRecipients(["support@sidestore.io"])
|
||||||
|
//
|
||||||
|
// if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String {
|
||||||
|
// mailViewController.setSubject("SideStore Beta \(version) Feedback")
|
||||||
|
// } else {
|
||||||
|
// mailViewController.setSubject("SideStore Beta Feedback")
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// self.present(mailViewController, animated: true, completion: nil)
|
||||||
|
// } else {
|
||||||
|
// let toastView = ToastView(text: NSLocalizedString("Cannot Send Mail", comment: ""), detailText: nil)
|
||||||
|
// toastView.show(in: self)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// Cancel action
|
||||||
|
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
|
||||||
|
|
||||||
|
// For iPad: Set the source view if presenting on iPad to avoid crashes
|
||||||
|
if let popoverController = alertController.popoverPresentationController {
|
||||||
|
popoverController.sourceView = self.view
|
||||||
|
popoverController.sourceRect = self.view.bounds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Present the action sheet
|
||||||
|
self.present(alertController, animated: true, completion: nil)
|
||||||
|
|
||||||
case .refreshSideJITServer:
|
case .refreshSideJITServer:
|
||||||
if #available(iOS 17, *) {
|
if #available(iOS 17, *) {
|
||||||
let alertController = UIAlertController(
|
let alertController = UIAlertController(
|
||||||
|
|||||||
Reference in New Issue
Block a user