mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
fix: saved data causes tags to be lost
This commit is contained in:
@@ -206,6 +206,14 @@ class NewHostDialogV2(owner: Window, private val editHost: Host? = null) : Dialo
|
|||||||
var host = panel.getHost()
|
var host = panel.getHost()
|
||||||
|
|
||||||
if (editHost != null) {
|
if (editHost != null) {
|
||||||
|
val extras = mutableMapOf<String, String>()
|
||||||
|
extras.putAll(editHost.options.extras)
|
||||||
|
extras.putAll(host.options.extras)
|
||||||
|
|
||||||
|
val tags = mutableListOf<String>()
|
||||||
|
tags.addAll(editHost.options.tags)
|
||||||
|
tags.addAll(host.options.tags)
|
||||||
|
|
||||||
host = editHost.copy(
|
host = editHost.copy(
|
||||||
name = host.name,
|
name = host.name,
|
||||||
protocol = host.protocol,
|
protocol = host.protocol,
|
||||||
@@ -215,7 +223,7 @@ class NewHostDialogV2(owner: Window, private val editHost: Host? = null) : Dialo
|
|||||||
authentication = host.authentication,
|
authentication = host.authentication,
|
||||||
proxy = host.proxy,
|
proxy = host.proxy,
|
||||||
remark = host.remark,
|
remark = host.remark,
|
||||||
options = host.options,
|
options = host.options.copy(extras = extras, tags = tags),
|
||||||
tunnelings = host.tunnelings,
|
tunnelings = host.tunnelings,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user