From 931569eeeac7a6b4a955c8132c0f8faf43ef3e01 Mon Sep 17 00:00:00 2001 From: Francisco Gindre Date: Thu, 16 Feb 2023 11:15:47 -0300 Subject: [PATCH] Fix swiftlint warnings (#544) * 0.0.1-40 * - [#543] Fix swiftlint warnings --- secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift | 3 +-- secant/Dependencies/CrashReporter/CrashReporterTestKey.swift | 2 +- .../UserPreferencesStorage/UserPreferencesStorageLive.swift | 1 - secant/Features/Settings/SettingsStore.swift | 4 ++-- secant/Features/Settings/SettingsView.swift | 5 +++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift b/secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift index ccde58d..c23cb0b 100644 --- a/secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift +++ b/secant/Dependencies/CrashReporter/CrashReporterLiveKey.swift @@ -8,7 +8,7 @@ import ComposableArchitecture import FirebaseCore import FirebaseCrashlytics extension CrashReporterClient: DependencyKey { - static let liveValue: CrashReporterClient = CrashReporterClient( + static let liveValue = CrashReporterClient( configure: { canConfigure in let fileName = "GoogleService-Info.plist" @@ -35,7 +35,6 @@ extension CrashReporterClient: DependencyKey { }, optOut: { Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false) - } ) } diff --git a/secant/Dependencies/CrashReporter/CrashReporterTestKey.swift b/secant/Dependencies/CrashReporter/CrashReporterTestKey.swift index 295b757..dc6483c 100644 --- a/secant/Dependencies/CrashReporter/CrashReporterTestKey.swift +++ b/secant/Dependencies/CrashReporter/CrashReporterTestKey.swift @@ -7,7 +7,7 @@ import ComposableArchitecture extension CrashReporterClient: TestDependencyKey { - static let testValue: CrashReporterClient = CrashReporterClient( + static let testValue = CrashReporterClient( configure: { _ in }, testCrash: {}, optIn: {}, diff --git a/secant/Dependencies/UserPreferencesStorage/UserPreferencesStorageLive.swift b/secant/Dependencies/UserPreferencesStorage/UserPreferencesStorageLive.swift index f43b1b7..236c2b2 100644 --- a/secant/Dependencies/UserPreferencesStorage/UserPreferencesStorageLive.swift +++ b/secant/Dependencies/UserPreferencesStorage/UserPreferencesStorageLive.swift @@ -34,7 +34,6 @@ extension UserPreferencesStorageClient: DependencyKey { }() } - extension UserPreferencesStorage { static let live = UserPreferencesStorage( appSessionFrom: Date().timeIntervalSince1970, diff --git a/secant/Features/Settings/SettingsStore.swift b/secant/Features/Settings/SettingsStore.swift index 6228322..d85909b 100644 --- a/secant/Features/Settings/SettingsStore.swift +++ b/secant/Features/Settings/SettingsStore.swift @@ -16,7 +16,7 @@ struct SettingsReducer: ReducerProtocol { var phraseDisplayState: RecoveryPhraseDisplayReducer.State var rescanDialog: ConfirmationDialogState? - @BindableState var isCrashReportingOn: Bool + @BindingState var isCrashReportingOn: Bool var tempSDKDir: URL { let tempDir = FileManager.default.temporaryDirectory @@ -94,7 +94,7 @@ struct SettingsReducer: ReducerProtocol { crashReporter.optIn() } - return .run { [state] send in + return .run { [state] _ in await userStoredPreferences.setIsUserOptedOutOfCrashReporting(state.isCrashReportingOn) } diff --git a/secant/Features/Settings/SettingsView.swift b/secant/Features/Settings/SettingsView.swift index d16609a..fd1b8a9 100644 --- a/secant/Features/Settings/SettingsView.swift +++ b/secant/Features/Settings/SettingsView.swift @@ -7,8 +7,9 @@ struct SettingsView: View { var body: some View { WithViewStore(store) { viewStore in VStack(spacing: 40) { - Toggle("Enable Crash Reporting", - isOn: viewStore.binding(\.$isCrashReportingOn) + Toggle( + "Enable Crash Reporting", + isOn: viewStore.binding(\.$isCrashReportingOn) ) Button( action: { viewStore.send(.backupWalletAccessRequest) },