diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 60bdffd4..dd1b895e 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -171,7 +171,7 @@ public struct SignInView: View { .padding(.horizontal, 20) .accessibilityIdentifier("signin_sso_heading") } - + Divider() VStack(alignment: .center) { @@ -192,9 +192,8 @@ public struct SignInView: View { .accessibilityIdentifier("signin_sso_login_subtitle") } } - + VStack(alignment: .center) { - if viewModel.isShowProgress { HStack(alignment: .center) { ProgressBar(size: 40, lineWidth: 8) @@ -209,7 +208,8 @@ public struct SignInView: View { action: { viewModel.router .showSSOWebBrowser(title: CoreLocalization.SignIn.logInBtn) - }) + } + ) .frame(maxWidth: .infinity) .padding(.top, 20) .accessibilityIdentifier("signin_SSO_button") @@ -219,15 +219,14 @@ public struct SignInView: View { action: { viewModel.router .showSSOWebBrowser(title: CoreLocalization.SignIn.logInBtn) - }, - color: .white, - textColor: Theme.Colors.accentColor, - borderColor: Theme.Colors.accentColor) + }, + color: .white, + textColor: Theme.Colors.accentColor, + borderColor: Theme.Colors.accentColor) .frame(maxWidth: .infinity) .padding(.top, 20) .accessibilityIdentifier("signin_SSO_button") } - } } } @@ -266,7 +265,7 @@ public struct SignInView: View { .transition(.move(edge: .top)) .onAppear { doAfter(Theme.Timeout.snackbarMessageLongTimeout) { - viewModel.alertMessage = nil + viewModel.alertMessage = nil } } } @@ -279,7 +278,7 @@ public struct SignInView: View { }.transition(.move(edge: .bottom)) .onAppear { doAfter(Theme.Timeout.snackbarMessageLongTimeout) { - viewModel.errorMessage = nil + viewModel.errorMessage = nil } } } @@ -291,12 +290,12 @@ public struct SignInView: View { viewModel.trackScreenEvent() } } - + @ViewBuilder private var agreements: some View { if let eulaURL = viewModel.config.agreement.eulaURL, - let tosURL = viewModel.config.agreement.tosURL, - let policy = viewModel.config.agreement.privacyPolicyURL { + let tosURL = viewModel.config.agreement.tosURL, + let policy = viewModel.config.agreement.privacyPolicyURL { let text = AuthLocalization.SignIn.agreement( "\(viewModel.config.platformName)", eulaURL, @@ -314,7 +313,7 @@ public struct SignInView: View { .environment(\.openURL, OpenURLAction(handler: handleURL)) } } - + private func handleURL(_ url: URL) -> OpenURLAction.Result { viewModel.router.showWebBrowser(title: "", url: url) return .handled diff --git a/Core/Core/Configuration/Config/DiscoveryConfig.swift b/Core/Core/Configuration/Config/DiscoveryConfig.swift index 90251d8c..1e8c9cb0 100644 --- a/Core/Core/Configuration/Config/DiscoveryConfig.swift +++ b/Core/Core/Configuration/Config/DiscoveryConfig.swift @@ -38,7 +38,7 @@ public class DiscoveryConfig: NSObject { public let type: DiscoveryConfigType public let webview: DiscoveryWebviewConfig public var isWebViewConfigured: Bool { - return type == .webview && webview.baseURL != nil + type == .webview && webview.baseURL != nil } init(dictionary: [String: AnyObject]) { diff --git a/Core/Core/Data/Model/Data_Media.swift b/Core/Core/Data/Model/Data_Media.swift index 8afef0de..3e06532a 100644 --- a/Core/Core/Data/Model/Data_Media.swift +++ b/Core/Core/Data/Model/Data_Media.swift @@ -40,7 +40,7 @@ public extension DataLayer { public extension DataLayer.CourseMedia { var domain: CourseMedia { - return CourseMedia( + CourseMedia( image: CourseImage( raw: image.raw, small: image.small, diff --git a/Core/Core/View/Base/FlexibleKeyboardInputView.swift b/Core/Core/View/Base/FlexibleKeyboardInputView.swift index ab452440..52e0b45c 100644 --- a/Core/Core/View/Base/FlexibleKeyboardInputView.swift +++ b/Core/Core/View/Base/FlexibleKeyboardInputView.swift @@ -48,7 +48,9 @@ public struct FlexibleKeyboardInputView: View { } ) .onPreferenceChange(ViewSizePreferenceKey.self) { size in - commentSize = size.height + Task { @MainActor in + commentSize = size.height + } } .overlay( TextEditor(text: $commentText) diff --git a/Course/Course.xcodeproj/project.pbxproj b/Course/Course.xcodeproj/project.pbxproj index ca106fe7..c07cbebd 100644 --- a/Course/Course.xcodeproj/project.pbxproj +++ b/Course/Course.xcodeproj/project.pbxproj @@ -104,7 +104,7 @@ CE6386682D07219B00C01D69 /* CourseDateListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6386672D07219B00C01D69 /* CourseDateListView.swift */; }; CE63866A2D0721B600C01D69 /* CompletedBlocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6386692D0721B600C01D69 /* CompletedBlocks.swift */; }; CE63866C2D0721D600C01D69 /* BlockStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866B2D0721D600C01D69 /* BlockStatusView.swift */; }; - CE63866E2D07220600C01D69 /* StyleBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866D2D07220600C01D69 /* StyleBlock.swift */; }; + CE63866E2D07220600C01D69 /* CourseDateStyleBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */; }; CE7CAF412CC1563500E0AC9D /* OEXFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = CE7CAF402CC1563500E0AC9D /* OEXFoundation */; }; CEB1E2732CC14EC400921517 /* OEXFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = CEB1E2722CC14EC400921517 /* OEXFoundation */; }; CEBCA4342CC13CDE00076589 /* YouTubePlayerKit in Frameworks */ = {isa = PBXBuildFile; productRef = CEBCA4332CC13CDE00076589 /* YouTubePlayerKit */; }; @@ -251,7 +251,7 @@ CE6386672D07219B00C01D69 /* CourseDateListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateListView.swift; sourceTree = ""; }; CE6386692D0721B600C01D69 /* CompletedBlocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletedBlocks.swift; sourceTree = ""; }; CE63866B2D0721D600C01D69 /* BlockStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockStatusView.swift; sourceTree = ""; }; - CE63866D2D07220600C01D69 /* StyleBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyleBlock.swift; sourceTree = ""; }; + CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateStyleBlock.swift; sourceTree = ""; }; DB205BFA2AE81B1200136EC2 /* CourseDateViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDateViewModelTests.swift; sourceTree = ""; }; DB7D6EAB2ADFCAC40036BB13 /* CourseDatesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CourseDatesView.swift; sourceTree = ""; }; DB7D6EAD2ADFCB4A0036BB13 /* CourseDatesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDatesViewModel.swift; sourceTree = ""; }; @@ -668,7 +668,7 @@ CE6386622D07215100C01D69 /* Elements */ = { isa = PBXGroup; children = ( - CE63866D2D07220600C01D69 /* StyleBlock.swift */, + CE63866D2D07220600C01D69 /* CourseDateStyleBlock.swift */, CE63866B2D0721D600C01D69 /* BlockStatusView.swift */, CE6386692D0721B600C01D69 /* CompletedBlocks.swift */, CE6386672D07219B00C01D69 /* CourseDateListView.swift */, @@ -996,7 +996,7 @@ BAC0E0DB2B32F0AE006B68A9 /* CourseVideoDownloadBarViewModel.swift in Sources */, DB7D6EAE2ADFCB4A0036BB13 /* CourseDatesViewModel.swift in Sources */, 067B7B522BED339200D1768F /* SubtitlesView.swift in Sources */, - CE63866E2D07220600C01D69 /* StyleBlock.swift in Sources */, + CE63866E2D07220600C01D69 /* CourseDateStyleBlock.swift in Sources */, CE63866C2D0721D600C01D69 /* BlockStatusView.swift in Sources */, 02868AE52C19FE0B0003E339 /* DownloadActionView.swift in Sources */, 07DE59862BECB868001CBFBC /* CourseAnalytics.swift in Sources */, diff --git a/Course/Course/Presentation/Dates/Elements/BlockStatusView.swift b/Course/Course/Presentation/Dates/Elements/BlockStatusView.swift index 8a422966..4e91d591 100644 --- a/Course/Course/Presentation/Dates/Elements/BlockStatusView.swift +++ b/Course/Course/Presentation/Dates/Elements/BlockStatusView.swift @@ -20,7 +20,7 @@ struct BlockStatusView: View { HStack(alignment: .top) { block.blockImage?.swiftUIImage .foregroundColor(Theme.Colors.textPrimary) - StyleBlock(block: block, viewModel: viewModel) + CourseDateStyleBlock(block: block, viewModel: viewModel) .padding(.bottom, 15) Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { diff --git a/Course/Course/Presentation/Dates/Elements/CompletedBlocks.swift b/Course/Course/Presentation/Dates/Elements/CompletedBlocks.swift index 81fef4b0..6b3ae36d 100644 --- a/Course/Course/Presentation/Dates/Elements/CompletedBlocks.swift +++ b/Course/Course/Presentation/Dates/Elements/CompletedBlocks.swift @@ -66,7 +66,7 @@ struct CompletedBlocks: View { HStack(alignment: .top) { block.blockImage?.swiftUIImage .foregroundColor(Theme.Colors.textPrimary) - StyleBlock(block: block, viewModel: viewModel) + CourseDateStyleBlock(block: block, viewModel: viewModel) .padding(.bottom, 15) Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { diff --git a/Course/Course/Presentation/Dates/Elements/StyleBlock.swift b/Course/Course/Presentation/Dates/Elements/CourseDateStyleBlock.swift similarity index 96% rename from Course/Course/Presentation/Dates/Elements/StyleBlock.swift rename to Course/Course/Presentation/Dates/Elements/CourseDateStyleBlock.swift index 3399ad74..630d062e 100644 --- a/Course/Course/Presentation/Dates/Elements/StyleBlock.swift +++ b/Course/Course/Presentation/Dates/Elements/CourseDateStyleBlock.swift @@ -1,5 +1,5 @@ // -// StyleBlock.swift +// CourseDateStyleBlock.swift // Course // // Created by Ivan Stepanok on 09.12.2024. @@ -9,7 +9,7 @@ import SwiftUI import Core import Theme -struct StyleBlock: View { +struct CourseDateStyleBlock: View { let block: CourseDateBlock let viewModel: CourseDatesViewModel diff --git a/OpenEdX/DI/ScreenAssembly.swift b/OpenEdX/DI/ScreenAssembly.swift index 509fb257..91bff664 100644 --- a/OpenEdX/DI/ScreenAssembly.swift +++ b/OpenEdX/DI/ScreenAssembly.swift @@ -410,7 +410,8 @@ class ScreenAssembly: Assembly { router.currentCourseTabSelection )! ) - }) + } + ) container.register( EncodedVideoPlayerViewModel.self, @@ -438,7 +439,8 @@ class ScreenAssembly: Assembly { connectivity: r.resolve(ConnectivityProtocol.self)!, playerHolder: holder ) - }) + } + ) container.register(PlayerDelegateProtocol.self) { r in PlayerDelegate(pipManager: r.resolve(PipManagerProtocol.self)!)