mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
feat(photo/client|sever): fetch photo on upload
This commit is contained in:
1 parent
6fc469c4a3
commit
1e771e87af
2 files changed
+10
No files matched your search
@@ -127,6 +127,10 @@ function takePhoto() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, () => {
|
||||||
|
emitNet(events.CAMERA_FETCH_PHOTOS);
|
||||||
|
})
|
||||||
|
|
||||||
// delete photo
|
// delete photo
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CAMERA_DELETE_PHOTO);
|
RegisterNuiCallbackType(events.CAMERA_DELETE_PHOTO);
|
||||||
|
|||||||
@@ -26,8 +26,14 @@ async function deletePhoto(photo: IPhoto, identifier: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
|
onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
|
||||||
|
try {
|
||||||
|
const pSource = (global as any).source;
|
||||||
const identifier = await useIdentifier();
|
const identifier = await useIdentifier();
|
||||||
await uploadPhoto(identifier, image);
|
await uploadPhoto(identifier, image);
|
||||||
|
emitNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, pSource);
|
||||||
|
} catch (error) {
|
||||||
|
console.dir(error)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.CAMERA_FETCH_PHOTOS, async () => {
|
onNet(events.CAMERA_FETCH_PHOTOS, async () => {
|
||||||
|
|||||||
Reference in new issue
Block a user