Fix build problems, also make "switch user" and "log out" buttons work on iOS

This commit is contained in:
Aiden Vigue 2021-07-27 23:48:56 -04:00
parent 68b3adf8cc
commit 295cb32419
No known key found for this signature in database
GPG Key ID: E7570472648F4544
5 changed files with 54 additions and 34 deletions

View File

@ -848,7 +848,6 @@
5377CBE9263B596A003A4E83 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = NO;
KnownAssetTags = (
New,
);
@ -1246,7 +1245,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\"";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_PREVIEWS = YES;
@ -1277,7 +1276,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "JellyfinPlayer tvOS/JellyfinPlayer tvOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEVELOPMENT_ASSET_PATHS = "\"JellyfinPlayer tvOS/Preview Content\"";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_PREVIEWS = YES;
@ -1429,7 +1428,7 @@
CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9R8RREG67J;
ENABLE_BITCODE = NO;
@ -1465,7 +1464,7 @@
CODE_SIGN_ENTITLEMENTS = JellyfinPlayer/JellyfinPlayer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9R8RREG67J;
@ -1498,7 +1497,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEVELOPMENT_TEAM = 9R8RREG67J;
INFOPLIST_FILE = WidgetExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@ -1525,7 +1524,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 57;
CURRENT_PROJECT_VERSION = 58;
DEVELOPMENT_TEAM = 9R8RREG67J;
INFOPLIST_FILE = WidgetExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@ -1660,18 +1659,18 @@
};
6260FFF726A09754003FA968 /* XCRemoteSwiftPackageReference "CombineExt" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/CombineCommunity/CombineExt";
repositoryURL = "https://github.com/acvigue/CombineExt";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.3.0;
branch = main;
kind = branch;
};
};
62CB3F442685BAF7003D0A6F /* XCRemoteSwiftPackageReference "Defaults" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/Defaults";
repositoryURL = "https://github.com/acvigue/Defaults";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

View File

@ -30,20 +30,20 @@
},
{
"package": "CombineExt",
"repositoryURL": "https://github.com/CombineCommunity/CombineExt",
"repositoryURL": "https://github.com/acvigue/CombineExt",
"state": {
"branch": null,
"revision": "5b8a0c0f178527f9204200505c5fefa6847e528f",
"version": "1.3.0"
"branch": "main",
"revision": "f629c5b052d1cb5d03e10890deccc50e4c649e68",
"version": null
}
},
{
"package": "Defaults",
"repositoryURL": "https://github.com/sindresorhus/Defaults",
"repositoryURL": "https://github.com/acvigue/Defaults",
"state": {
"branch": null,
"revision": "63d93f97ad545c8bceb125a8a36175ea705f7cf5",
"version": "5.0.0"
"branch": "main",
"revision": "a4153b523ab3df9f5e3f70e9cfe9c54bed98c7e3",
"version": null
}
},
{
@ -56,7 +56,7 @@
}
},
{
"package": "jellyfin-sdk-swift",
"package": "JellyfinAPI",
"repositoryURL": "https://github.com/jellyfin/jellyfin-sdk-swift",
"state": {
"branch": "main",
@ -65,7 +65,7 @@
}
},
{
"package": "keychain-swift",
"package": "KeychainSwift",
"repositoryURL": "https://github.com/evgenyneu/keychain-swift",
"state": {
"branch": null,
@ -119,7 +119,7 @@
}
},
{
"package": "SwiftUI-Introspect",
"package": "Introspect",
"repositoryURL": "https://github.com/siteline/SwiftUI-Introspect",
"state": {
"branch": null,
@ -150,8 +150,8 @@
"repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state": {
"branch": null,
"revision": "603974e3909ad4b48ba04aad7e0ceee4f077a518",
"version": "0.1.0"
"revision": "152390e9e78ebbf0d767ee52971d41e7f44f39bc",
"version": "0.1.1"
}
}
]

View File

@ -56,11 +56,17 @@ struct ConnectToServerView: View {
ForEach(viewModel.publicUsers, id: \.id) { publicUser in
HStack {
Button(action: {
username = publicUser.name ?? ""
viewModel.publicUsers.removeAll()
if !(publicUser.hasPassword ?? true) {
password = ""
viewModel.login()
if SessionManager.current.doesUserHaveSavedSession(userID: publicUser.id!) {
let user = SessionManager.current.getSavedSession(userID: publicUser.id!)
SessionManager.current.loginWithSavedSession(user: user)
} else {
username = publicUser.name ?? ""
viewModel.selectedPublicUser = publicUser
viewModel.hidePublicUsers()
if !(publicUser.hasPassword ?? true) {
password = ""
viewModel.login()
}
}
}) {
HStack {

View File

@ -191,7 +191,8 @@ class EmailHelper: NSObject, MFMailComposeViewControllerDelegate {
let fileManager = FileManager()
let data = fileManager.contents(atPath: logURL.path)
picker.setSubject("SwiftFin Shake Report")
picker.setSubject("[DEV-BUG] SwiftFin")
picker.setMessageBody("Please don't edit this email.\n Please don't change the subject. \nUDID: \(UIDevice.current.identifierForVendor?.uuidString ?? "NIL")\n", isHTML: false);
picker.setToRecipients(["SwiftFin Bug Reports <swiftfin-bugs@jellyfin.org>"])
picker.addAttachmentData(data!, mimeType: "text/plain", fileName: logURL.lastPathComponent)
picker.mailComposeDelegate = self

View File

@ -77,12 +77,26 @@ struct SettingsView: View {
Text("Signed in as \(username)").foregroundColor(.primary)
Spacer()
Button {
let nc = NotificationCenter.default
nc.post(name: Notification.Name("didSignOut"), object: nil)
print("logging out");
close = false;
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
let nc = NotificationCenter.default
nc.post(name: Notification.Name("didSignOut"), object: nil)
}
} label: {
Text("Switch user").font(.callout)
}
}
Button {
close = false;
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
SessionManager.current.logout();
let nc = NotificationCenter.default
nc.post(name: Notification.Name("didSignOut"), object: nil)
}
} label: {
Text("Sign out").font(.callout)
}
}
}
.navigationBarTitle("Settings", displayMode: .inline)