fix: ios
Deskripsi : - load refresh pada project - load refresh pada task divisi - text pada modal salin atau pindah - crash modal pada modal more dokumen divisi - memberi loadin pada modal info dokumen divisi - crash modal pada header dokumen divisi - kyboard avoiding pada project - keyboard avoiding pada tugas divisi - image pada user yg diselect pada tambah anggota divisi nb : qc blm selesai No Issues
This commit is contained in:
@@ -112,7 +112,7 @@ export default function DocumentDivision() {
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad(true);
|
||||
}, [path, update]);
|
||||
}, [path]);
|
||||
|
||||
const handleCheckboxChange = (index: number) => {
|
||||
setDariSelectAll(false);
|
||||
@@ -243,6 +243,7 @@ export default function DocumentDivision() {
|
||||
|
||||
useEffect(() => {
|
||||
handleBatal();
|
||||
handleLoad(false)
|
||||
}, [update]);
|
||||
|
||||
async function handleShare(selectedDivision: any[]) {
|
||||
@@ -270,7 +271,7 @@ export default function DocumentDivision() {
|
||||
|
||||
|
||||
const openFile = (item: Props) => {
|
||||
setLoadingOpen(true)
|
||||
if (Platform.OS == 'android') setLoadingOpen(true)
|
||||
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
|
||||
const fileName = item.name + '.' + item.extension;
|
||||
let localPath = `${FileSystem.documentDirectory}/${fileName}`;
|
||||
@@ -278,9 +279,9 @@ export default function DocumentDivision() {
|
||||
|
||||
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
|
||||
const contentURL = await FileSystem.getContentUriAsync(uri);
|
||||
setLoadingOpen(false)
|
||||
try {
|
||||
if (Platform.OS == 'android') {
|
||||
// open with android intent
|
||||
await startActivityAsync(
|
||||
'android.intent.action.VIEW',
|
||||
{
|
||||
@@ -289,16 +290,13 @@ export default function DocumentDivision() {
|
||||
type: mimeType as string,
|
||||
}
|
||||
);
|
||||
// or
|
||||
// Sharing.shareAsync(localPath);
|
||||
|
||||
} else if (Platform.OS == 'ios') {
|
||||
Sharing.shareAsync(localPath);
|
||||
}
|
||||
} catch (error) {
|
||||
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
|
||||
} finally {
|
||||
setLoadingOpen(false)
|
||||
if (Platform.OS == 'android') setLoadingOpen(false)
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -375,7 +373,7 @@ export default function DocumentDivision() {
|
||||
}}
|
||||
>
|
||||
{item.id != "home" && (
|
||||
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} />
|
||||
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} color="black" />
|
||||
)}
|
||||
<Text> {item.name} </Text>
|
||||
</Pressable>
|
||||
@@ -538,13 +536,11 @@ export default function DocumentDivision() {
|
||||
<DrawerBottom
|
||||
animation="slide"
|
||||
isVisible={modalMore}
|
||||
setVisible={setModalMore}
|
||||
setVisible={() => { setModalMore(false) }}
|
||||
title=""
|
||||
>
|
||||
<ModalMore
|
||||
onClose={() => {
|
||||
setModalMore(false);
|
||||
}}
|
||||
onClose={() => { setModalMore(false); }}
|
||||
data={selectedFiles}
|
||||
share={shareSelected}
|
||||
/>
|
||||
@@ -553,7 +549,7 @@ export default function DocumentDivision() {
|
||||
<ModalFloat
|
||||
title="Ganti Nama"
|
||||
isVisible={isRename}
|
||||
setVisible={setRename}
|
||||
setVisible={() => { setRename(false) }}
|
||||
onSubmit={() => {
|
||||
handleRename();
|
||||
}}
|
||||
@@ -576,7 +572,7 @@ export default function DocumentDivision() {
|
||||
title="Bagikan"
|
||||
category="share-division"
|
||||
open={isShare}
|
||||
close={setShare}
|
||||
close={() => { setShare(false) }}
|
||||
onSelect={(value) => {
|
||||
handleShare(value)
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user