upd: button save

Deskripsi:
- disable button saat udh submit

No Issues
This commit is contained in:
2025-08-04 13:56:33 +08:00
parent b7c44109a1
commit fafb52d87c
31 changed files with 211 additions and 64 deletions

View File

@@ -38,6 +38,7 @@ export default function CreateTaskDivision() {
const [title, setTitle] = useState('')
const [error, setError] = useState(false);
const [isModal, setModal] = useState(false)
const [loading, setLoading] = useState(false)
let hitung = 0;
useEffect(() => {
@@ -77,6 +78,7 @@ export default function CreateTaskDivision() {
async function handleCreate() {
try {
setLoading(true)
const hasil = await decryptToken(String(token?.current))
const fd = new FormData()
@@ -102,6 +104,9 @@ export default function CreateTaskDivision() {
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoading(false)
}
}
@@ -121,7 +126,7 @@ export default function CreateTaskDivision() {
headerTitleAlign: "center",
headerRight: () => (
<ButtonSaveHeader
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0}
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0 || loading}
category="create"
onPress={() => { handleCreate() }}
/>