diff --git a/Passepartout.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Passepartout.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 65c5c217..453e7614 100644 --- a/Passepartout.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Passepartout.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,7 @@ "kind" : "remoteSourceControl", "location" : "git@github.com:passepartoutvpn/passepartoutkit", "state" : { - "revision" : "3d1a60be9722861f9de45e355d520bae33ac87a9" + "revision" : "fd4fe153c17a33d43a2e75d58512194ac3588eba" } }, { diff --git a/Passepartout/Library/Package.swift b/Passepartout/Library/Package.swift index 304e3b21..b583c6fa 100644 --- a/Passepartout/Library/Package.swift +++ b/Passepartout/Library/Package.swift @@ -31,7 +31,7 @@ let package = Package( ], dependencies: [ // .package(url: "git@github.com:passepartoutvpn/passepartoutkit", from: "0.7.0"), - .package(url: "git@github.com:passepartoutvpn/passepartoutkit", revision: "3d1a60be9722861f9de45e355d520bae33ac87a9"), + .package(url: "git@github.com:passepartoutvpn/passepartoutkit", revision: "fd4fe153c17a33d43a2e75d58512194ac3588eba"), // .package(path: "../../../passepartoutkit"), .package(url: "git@github.com:passepartoutvpn/passepartoutkit-openvpn-openssl", from: "0.6.0"), // .package(path: "../../../passepartoutkit-openvpn-openssl"), diff --git a/Passepartout/Library/Sources/AppUI/Business/ProfileImporter.swift b/Passepartout/Library/Sources/AppUI/Business/ProfileImporter.swift index 211dd9c6..4654bd58 100644 --- a/Passepartout/Library/Sources/AppUI/Business/ProfileImporter.swift +++ b/Passepartout/Library/Sources/AppUI/Business/ProfileImporter.swift @@ -125,11 +125,14 @@ private extension ProfileImporter { } let module = try registry.module(fromURL: url, object: passphrase) + var onDemandModuleBuilder = OnDemandModule.Builder() + onDemandModuleBuilder.isEnabled = false + let onDemandModule = onDemandModuleBuilder.tryBuild() var builder = Profile.Builder() builder.name = url.lastPathComponent - builder.modules = [module] - builder.activeModulesIds = [module.id] + builder.modules = [module, onDemandModule] + builder.activeModulesIds = Set(builder.modules.map(\.id)) let profile = try builder.tryBuild() try await profileManager.save(profile) diff --git a/Passepartout/Library/Tests/AppUITests/ProfileImporterTests.swift b/Passepartout/Library/Tests/AppUITests/ProfileImporterTests.swift index 04dccf74..80d8c064 100644 --- a/Passepartout/Library/Tests/AppUITests/ProfileImporterTests.swift +++ b/Passepartout/Library/Tests/AppUITests/ProfileImporterTests.swift @@ -61,8 +61,9 @@ extension ProfileImporterTests { .sink { switch $0 { case .save(let profile): - XCTAssertEqual(profile.modules.count, 1) + XCTAssertEqual(profile.modules.count, 2) XCTAssertTrue(profile.modules.first is SomeModule) + XCTAssertTrue(profile.modules.last is OnDemandModule) exp.fulfill() default: @@ -92,8 +93,9 @@ extension ProfileImporterTests { .sink { switch $0 { case .save(let profile): - XCTAssertEqual(profile.modules.count, 1) + XCTAssertEqual(profile.modules.count, 2) XCTAssertTrue(profile.modules.first is SomeModule) + XCTAssertTrue(profile.modules.last is OnDemandModule) exp.fulfill() default: