Add "https://" to the config URI if it doesn't exist

This commit is contained in:
Benoit Martins 2026-03-09 15:01:51 +01:00
parent 9d78fc2e29
commit 1bb372741e
3 changed files with 8 additions and 4 deletions

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo {
public static let branch = "master"
public static let commit = "d0418ae07"
public static let commit = "9d78fc2e2"
public static let tag = "6.1.0-alpha"
}

View file

@ -219,10 +219,10 @@ struct ToastView: View {
.default_text_style(styleSize: 15)
.padding(8)
case "uri_handler_config_success":
case "Success_uri_handler_config_success":
Text("uri_handler_config_success_toast")
.multilineTextAlignment(.center)
.foregroundStyle(Color.redDanger500)
.foregroundStyle(Color.greenSuccess500)
.default_text_style(styleSize: 15)
.padding(8)

View file

@ -50,7 +50,7 @@ class URIHandler {
CoreContext.shared.removeCoreDelegateStub(delegate: uriHandlerCoreDelegate!)
}
if state == .Successful {
toast("uri_handler_config_success")
toast("Success_uri_handler_config_success")
CoreContext.shared.removeCoreDelegateStub(delegate: uriHandlerCoreDelegate!)
}
})
@ -106,6 +106,10 @@ class URIHandler {
urlString = String(urlString.dropFirst(2))
}
if !urlString.starts(with: "https://") {
urlString = "https://" + urlString
}
core.config?.setString(section: "misc", key: "config-uri", value: urlString)
try core.setProvisioninguri(newValue: urlString)
core.stop()