Skip to content
Merged

V3 #23

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions VITTY/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@ struct ContentView: View {

}
}

#Preview {
ContentView()
}
25 changes: 0 additions & 25 deletions VITTY/VITTY.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
4B37F1E62E03D7D300DCEE5F /* ExistingHotelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B37F1E52E03D7D300DCEE5F /* ExistingHotelView.swift */; };
4B37F1E92E04173A00DCEE5F /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B37F1E82E04173500DCEE5F /* SettingsViewModel.swift */; };
4B40FE5D2E0A917F000BDD07 /* QrCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B40FE5C2E0A9179000BDD07 /* QrCode.swift */; };
4B40FE5D2E0A917F000BDD07 /* QrCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B40FE5C2E0A9179000BDD07 /* QrCode.swift */; };
4B47CD7B2D7DCB8B00A46FEF /* CreateReminder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B47CD7A2D7DCB8400A46FEF /* CreateReminder.swift */; };
4B4FCF632D317AFD002B392C /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4B4FCF622D317AFD002B392C /* GoogleService-Info.plist */; };
4B5977472DF97D5C009CC224 /* RemainderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5977462DF97D5A009CC224 /* RemainderModel.swift */; };
Expand All @@ -46,11 +45,6 @@
4B74D8772E0BF77800B390E9 /* Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8762E0BF77400B390E9 /* Alerts.swift */; };
4B74D8792E0BFC6000B390E9 /* FileUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */; };
4B74D87B2E0BFC7E00B390E9 /* FileUploadHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D87A2E0BFC7900B390E9 /* FileUploadHelper.swift */; };
4B74D8732E0BDF2100B390E9 /* CourseFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */; };
4B74D8742E0BDF2100B390E9 /* CourseFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */; };
4B74D8772E0BF77800B390E9 /* Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8762E0BF77400B390E9 /* Alerts.swift */; };
4B74D8792E0BFC6000B390E9 /* FileUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */; };
4B74D87B2E0BFC7E00B390E9 /* FileUploadHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74D87A2E0BFC7900B390E9 /* FileUploadHelper.swift */; };
4B7DA5DC2D708BD3007354A3 /* LectureItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7DA5DB2D708BCD007354A3 /* LectureItemView.swift */; };
4B7DA5DF2D7094E8007354A3 /* Academics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7DA5DE2D7094E3007354A3 /* Academics.swift */; };
4B7DA5E12D70A728007354A3 /* FriendRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B7DA5E02D70A71C007354A3 /* FriendRow.swift */; };
Expand Down Expand Up @@ -204,18 +198,13 @@
4B37F1E52E03D7D300DCEE5F /* ExistingHotelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExistingHotelView.swift; sourceTree = "<group>"; };
4B37F1E82E04173500DCEE5F /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = "<group>"; };
4B40FE5C2E0A9179000BDD07 /* QrCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCode.swift; sourceTree = "<group>"; };
4B40FE5C2E0A9179000BDD07 /* QrCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCode.swift; sourceTree = "<group>"; };
4B47CD7A2D7DCB8400A46FEF /* CreateReminder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateReminder.swift; sourceTree = "<group>"; };
4B4FCF622D317AFD002B392C /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
4B5977462DF97D5A009CC224 /* RemainderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemainderModel.swift; sourceTree = "<group>"; };
4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseFile.swift; sourceTree = "<group>"; };
4B74D8762E0BF77400B390E9 /* Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alerts.swift; sourceTree = "<group>"; };
4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileUpload.swift; sourceTree = "<group>"; };
4B74D87A2E0BFC7900B390E9 /* FileUploadHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileUploadHelper.swift; sourceTree = "<group>"; };
4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseFile.swift; sourceTree = "<group>"; };
4B74D8762E0BF77400B390E9 /* Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alerts.swift; sourceTree = "<group>"; };
4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileUpload.swift; sourceTree = "<group>"; };
4B74D87A2E0BFC7900B390E9 /* FileUploadHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileUploadHelper.swift; sourceTree = "<group>"; };
4B7DA5DB2D708BCD007354A3 /* LectureItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LectureItemView.swift; sourceTree = "<group>"; };
4B7DA5DE2D7094E3007354A3 /* Academics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Academics.swift; sourceTree = "<group>"; };
4B7DA5E02D70A71C007354A3 /* FriendRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendRow.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -492,19 +481,9 @@
path = Components;
sourceTree = "<group>";
};
4B74D8752E0BF76B00B390E9 /* Components */ = {
isa = PBXGroup;
children = (
4B74D87A2E0BFC7900B390E9 /* FileUploadHelper.swift */,
4B74D8762E0BF77400B390E9 /* Alerts.swift */,
);
path = Components;
sourceTree = "<group>";
};
4B7DA5DD2D7094CA007354A3 /* Academics */ = {
isa = PBXGroup;
children = (
4B74D8752E0BF76B00B390E9 /* Components */,
4B74D8752E0BF76B00B390E9 /* Components */,
4BBB002F2D95510B003B8FE2 /* Model */,
4BBB002E2D955104003B8FE2 /* VIewModel */,
Expand Down Expand Up @@ -533,7 +512,6 @@
4B7DA5EB2D71E0F4007354A3 /* Components */ = {
isa = PBXGroup;
children = (
4B40FE5C2E0A9179000BDD07 /* QrCode.swift */,
4B40FE5C2E0A9179000BDD07 /* QrCode.swift */,
4BF0C79E2D94694000016202 /* InsideCircleCards.swift */,
4B7DA5E62D71AC51007354A3 /* CirclesRow.swift */,
Expand All @@ -547,7 +525,6 @@
4B7DA5EC2D71E0FB007354A3 /* View */ = {
isa = PBXGroup;
children = (
4B2DD6942E0A702D00BC3B67 /* CircleRequests.swift */,
4B2DD6942E0A702D00BC3B67 /* CircleRequests.swift */,
4B7DA5E42D70B2C8007354A3 /* Circles.swift */,
4BF0C79C2D94680A00016202 /* InsideCircle.swift */,
Expand Down Expand Up @@ -576,7 +553,6 @@
4BBB002D2D9550F8003B8FE2 /* View */ = {
isa = PBXGroup;
children = (
4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */,
4B74D8782E0BFC5A00B390E9 /* FileUpload.swift */,
4B183EE72D7C78B300C9D801 /* Courses.swift */,
4BF03C982D7819E00098C803 /* Notes.swift */,
Expand All @@ -602,7 +578,6 @@
4BBB002F2D95510B003B8FE2 /* Model */ = {
isa = PBXGroup;
children = (
4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */,
4B74D8722E0BDF1E00B390E9 /* CourseFile.swift */,
4B5977462DF97D5A009CC224 /* RemainderModel.swift */,
4BBB00322D957A6A003B8FE2 /* NotesModel.swift */,
Expand Down
38 changes: 29 additions & 9 deletions VITTY/VITTY/Auth/ViewModels/AuthViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,7 @@ class AuthViewModel: NSObject, ASAuthorizationControllerDelegate {
}


private func firebaseUserAuthUpdate(with auth: Auth, user: User?) {
logger.info("Firebase User Auth State Updated")
DispatchQueue.main.async {
guard user != self.loggedInFirebaseUser else { return }
self.loggedInFirebaseUser = user
}
}


func login(with loginOptions: LoginOptions) async {
logger.info("Loging In...")
Expand Down Expand Up @@ -337,12 +331,38 @@ class AuthViewModel: NSObject, ASAuthorizationControllerDelegate {
func signOut() {
do {
try firebaseAuth.signOut()


UserDefaults.resetDefaults()
}
catch {


DispatchQueue.main.async {
self.loggedInBackendUser = nil
self.loggedInFirebaseUser = nil
}


print(self.loggedInBackendUser ?? "the backend user is set to nil ")

logger.info("User signed out successfully")

} catch {
logger.error("Error Signing Out: \(error)")
}
}


private func firebaseUserAuthUpdate(with auth: Auth, user: User?) {
logger.info("Firebase User Auth State Updated")
DispatchQueue.main.async {
self.loggedInFirebaseUser = user


if user == nil {
self.loggedInBackendUser = nil
}
}
}
}

extension UserDefaults {
Expand Down
5 changes: 5 additions & 0 deletions VITTY/VITTY/Connect/Models/CircleModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ struct CircleModel: Decodable {
let circleID: String
let circleName: String
let circleRole: String
let circleJoinCode: String

enum CodingKeys: String, CodingKey {
case circleID = "circle_id"
case circleName = "circle_name"
case circleRole = "circle_role"
case circleJoinCode = "circle_join_code"



}
}

Expand Down
Loading
Loading