SyncMadeEasy/force-app/main/default/aura/configurationSetting/configurationSettingControl...

44 lines
1.6 KiB
JavaScript

({
doInit : function(component, event, helper) {
setTimeout(function(){
//event.getSource().set("v.iconName" , 'utility:download');
//event.getSource().set("v.label" , 'Save');
component.set("v.SpinnerValue",false);
}, 2000);
},
doSync : function(component, event, helper) {
//var obj = component.get("v.contactList");
component.set("v.isProcess",true);
component.set("v.disablebutton", true);
var action = component.get("c.syncShopify");
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS"){
component.set("v.ShowSyncButton",false);
component.getEvent("ParentSaveButtonEvt").fire();
/* var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
mode: 'sticky',
title: "Success!",
message: "Process has started in the background.",
type: "success"
});
toastEvent.fire();*/
// alert('Process has started in the background.');
}else{
/*var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
mode: 'sticky',
title: "Error!",
message: "We have hit some error. Please Contact Admin.",
type: "error"
});
toastEvent.fire();*/
// alert('We have hit some error. Please Contact Admin.');
}
});
$A.enqueueAction(action);
},
})