i have a problem with following function;
const handleSave = (task, description, priorityState, taskID) => {
changeLabel(task, taskID);
changeDescription(description, taskID);
changePriority(priorityState, taskID);
navigation.goBack();
};
the problem is thats only change the last used function:
if i'll change the Label and the Description its only save the Description for example. < i call the function while clicking a Button (TouchableOpacity)
<Button
title={language.edit.save}
color={theme.secondary}
onPress={() => {
handleSave(task, description, priorityState, taskID);
}}
/>
any advise?
what did i try? delay the functions:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const handleSave = (task, description, priorityState, taskID) => {
changeLabel(task, taskID);
sleep(10);
changeDescription(description, taskID);
sleep(10); ...
};
i would like to thank any kind of help <3