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

View File

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

View File

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

View File

@ -191,7 +191,8 @@ class EmailHelper: NSObject, MFMailComposeViewControllerDelegate {
let fileManager = FileManager() let fileManager = FileManager()
let data = fileManager.contents(atPath: logURL.path) 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.setToRecipients(["SwiftFin Bug Reports <swiftfin-bugs@jellyfin.org>"])
picker.addAttachmentData(data!, mimeType: "text/plain", fileName: logURL.lastPathComponent) picker.addAttachmentData(data!, mimeType: "text/plain", fileName: logURL.lastPathComponent)
picker.mailComposeDelegate = self picker.mailComposeDelegate = self

View File

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