Skip to content

Commit

Permalink
Make sure sync method is not saved when user click cancel
Browse files Browse the repository at this point in the history
(reference #118)
  • Loading branch information
piotrzarzycki21 committed Jan 15, 2025
1 parent e6e6a18 commit f8b3752
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/superhuman/components/ConfigPage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ class ConfigPage extends Page {

function _syncMethodCheckTriggered( e:TriggerEvent ) {
_syncMethodCheck.text = _syncMethodCheck.selected ? SyncMethod.Rsync : SyncMethod.SCP;
_server.syncMethod = _syncMethodCheck.selected ? SyncMethod.Rsync : SyncMethod.SCP;
}

function _inputHostnameChanged( e:Event ) {
Expand Down Expand Up @@ -427,7 +426,7 @@ class ConfigPage extends Page {
// Making sure the event is fired
var a = _server.roles.value.copy();
_server.roles.value = a;

_server.syncMethod = _syncMethodCheck.selected ? SyncMethod.Rsync : SyncMethod.SCP;
_server.hostname.value = StringTools.trim( _inputHostname.text );
_server.organization.value = StringTools.trim( _inputOrganization.text );
var dvv:ProvisionerDefinition = cast _dropdownCoreComponentVersion.selectedItem;
Expand All @@ -454,6 +453,13 @@ class ConfigPage extends Page {

}

override function _cancel( ?e:Dynamic ) {
super._cancel(e);

_syncMethodCheck.text = _server.syncMethod;
_syncMethodCheck.selected = _server.syncMethod == SyncMethod.Rsync;
}

function _dropdownCoreComponentVersionChangeHandler(event:Event):Void {
var dvv:ProvisionerDefinition = cast _dropdownCoreComponentVersion.selectedItem;
_rowSyncMethod.visible = _rowSyncMethod.includeInLayout = dvv.data.version > "0.1.22";
Expand Down

0 comments on commit f8b3752

Please sign in to comment.