fix: Config shows changed when not yet initialized
This commit is contained in:
parent
bd47cb201f
commit
a4db054b59
3 changed files with 6 additions and 0 deletions
|
@ -89,6 +89,8 @@ class ZigToolchainEditor(private val sharedState: ZigProjectConfigurationProvide
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isModified(context: Project): Boolean {
|
override fun isModified(context: Project): Boolean {
|
||||||
|
if (isEmpty)
|
||||||
|
return false
|
||||||
val uuid = selectedUUID
|
val uuid = selectedUUID
|
||||||
if (ZigToolchainService.getInstance(context).toolchainUUID != selectedUUID) {
|
if (ZigToolchainService.getInstance(context).toolchainUUID != selectedUUID) {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -82,6 +82,8 @@ abstract class UUIDMapSelector<T>(val driver: UUIDComboBoxDriver<T>): Disposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected val isEmpty: Boolean get() = model.isEmpty
|
||||||
|
|
||||||
protected open fun onSelection(uuid: UUID?) {}
|
protected open fun onSelection(uuid: UUID?) {}
|
||||||
|
|
||||||
private fun refreshButtonState(item: ListElem<*>) {
|
private fun refreshButtonState(item: ListElem<*>) {
|
||||||
|
|
|
@ -58,6 +58,8 @@ class ZLSEditor<T: ZigToolchain>(private val sharedState: ZigProjectConfiguratio
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isModified(toolchain: T): Boolean {
|
override fun isModified(toolchain: T): Boolean {
|
||||||
|
if (isEmpty)
|
||||||
|
return false
|
||||||
return toolchain.zlsUUID != selectedUUID
|
return toolchain.zlsUUID != selectedUUID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue