Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Friese <[email protected]>
  • Loading branch information
peterfriese committed Nov 20, 2024
1 parent e67c5ca commit 849259b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import Firebase
import FirebaseAuth
import FirebaseDataConnect
import FriendlyFlixSDK
import SwiftUI
import os
import SwiftUI

@main
struct FriendlyFlixApp: App {
Expand All @@ -29,7 +29,7 @@ struct FriendlyFlixApp: App {
/// To use the local emulator, go to the active scheme, and add `-useEmulator YES`
/// to the _Arguments Passed On Launch_ section.
public var useEmulator: Bool {
let value = UserDefaults.standard.bool(forKey: "useEmulator")
let value = UserDefaults.standard.bool(forKey: "useEmulator")
logger.log("Using the emulator: \(value == true ? "YES" : "NO")")
return value
}
Expand All @@ -38,7 +38,7 @@ struct FriendlyFlixApp: App {
FirebaseApp.configure()
if useEmulator {
DataConnect.friendlyFlixConnector.useEmulator(port: 9399)
Auth.auth().useEmulator(withHost: "localhost", port:9099)
Auth.auth().useEmulator(withHost: "localhost", port: 9099)
}

authenticationService = AuthenticationService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

import AuthenticationServices
import SwiftUI
import os
import SwiftUI

private enum FocusableField: Hashable {
case email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class AuthenticationService {
try await Auth.auth().createUser(withEmail: email, password: password)

if let onSignUp, let user = Auth.auth().currentUser {
logger.debug("User signed in \(user.displayName ?? "(no fullname)") with email \(user.email ?? "(no email)")")
logger
.debug(
"User signed in \(user.displayName ?? "(no fullname)") with email \(user.email ?? "(no email)")"
)
onSignUp(user)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import FirebaseDataConnect
import FriendlyFlixSDK
import NukeUI
import SwiftUI
import os
import SwiftUI

struct MovieCardView: View {
private let logger = Logger(subsystem: "FriendlyFlix", category: "moviecard")
Expand All @@ -34,6 +34,7 @@ struct MovieCardView: View {
}

// MARK: - Favourite handling

private let isFavouriteRef: QueryRefObservation<
GetIfFavoritedMovieQuery.Data,
GetIfFavoritedMovieQuery.Variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation

import FirebaseCore
Expand Down Expand Up @@ -700,7 +686,7 @@ public class ListMoviesQuery {

rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container)

tags = try codecHelper.decode([String].self, forKey: .tags, container: &container)
tags = try codecHelper.decode([String]?.self, forKey: .tags, container: &container)

description = try codecHelper.decode(
String?.self,
Expand Down Expand Up @@ -1087,7 +1073,7 @@ public class GetMovieByIdQuery {
container: &container
)

tags = try codecHelper.decode([String].self, forKey: .tags, container: &container)
tags = try codecHelper.decode([String]?.self, forKey: .tags, container: &container)

metadata = try codecHelper.decode(
[MovieMetadataMetadata].self,
Expand Down Expand Up @@ -1255,7 +1241,7 @@ public class GetActorByIdQuery {

genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container)

tags = try codecHelper.decode([String].self, forKey: .tags, container: &container)
tags = try codecHelper.decode([String]?.self, forKey: .tags, container: &container)

imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container)
}
Expand Down Expand Up @@ -1316,7 +1302,7 @@ public class GetActorByIdQuery {

genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container)

tags = try codecHelper.decode([String].self, forKey: .tags, container: &container)
tags = try codecHelper.decode([String]?.self, forKey: .tags, container: &container)

imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container)
}
Expand Down Expand Up @@ -1638,7 +1624,7 @@ public class GetCurrentUserQuery {
container: &container
)

tags = try codecHelper.decode([String].self, forKey: .tags, container: &container)
tags = try codecHelper.decode([String]?.self, forKey: .tags, container: &container)

metadata = try codecHelper.decode(
[MovieMetadataMetadata].self,
Expand Down

0 comments on commit 849259b

Please sign in to comment.