upd: toast alert

This commit is contained in:
2026-02-24 17:44:49 +08:00
parent 214a243e44
commit 8c6ff06216
67 changed files with 384 additions and 187 deletions

View File

@@ -40,9 +40,11 @@ export default function HeaderRightDocument({ path, isMember }: { path: string,
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal membuat folder"
Toast.show({ type: 'small', text1: message })
} finally {
setLoadingFolder(false)
setNewFolder(false)
@@ -93,9 +95,11 @@ export default function HeaderRightDocument({ path, isMember }: { path: string,
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal mengunggah file"
Toast.show({ type: 'small', text1: message })
} finally {
setVisible(false)
setLoading(false)

View File

@@ -71,9 +71,11 @@ export default function ModalMore({
} else {
Toast.show({ type: 'small', text1: response.message, });
}
} catch (error) {
} catch (error : any ) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', });
const message = error?.response?.data?.message || "Gagal memindahkan file"
Toast.show({ type: 'small', text1: message })
} finally {
setIsCut(false);
onClose();
@@ -95,9 +97,11 @@ export default function ModalMore({
} else {
Toast.show({ type: 'small', text1: response.message, });
}
} catch (error) {
} catch (error : any ) {
console.error(error);
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', });
const message = error?.response?.data?.message || "Gagal menyalin file"
Toast.show({ type: 'small', text1: message })
} finally {
setIsCopy(false);
onClose();

View File

@@ -29,9 +29,11 @@ export function ModalNewFolder({ path, onCreated }: { path: string, onCreated: (
} else {
Toast.show({ type: 'small', text1: response.message, })
}
} catch (error) {
console.error(error)
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} catch (error : any ) {
console.error(error);
const message = error?.response?.data?.message || "Gagal membuat folder"
Toast.show({ type: 'small', text1: message })
} finally {
onCreated()
setLoadingFolder(false)