mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(photo/client|sever): fetch photo on upload
This commit is contained in:
1 parent
6fc469c4a3
commit
1e771e87af
2 files changed
+12
-2
No files matched your search
@@ -127,6 +127,10 @@ function takePhoto() {
|
||||
);
|
||||
}
|
||||
|
||||
onNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, () => {
|
||||
emitNet(events.CAMERA_FETCH_PHOTOS);
|
||||
})
|
||||
|
||||
// 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) => {
|
||||
const identifier = await useIdentifier();
|
||||
await uploadPhoto(identifier, image);
|
||||
try {
|
||||
const pSource = (global as any).source;
|
||||
const identifier = await useIdentifier();
|
||||
await uploadPhoto(identifier, image);
|
||||
emitNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, pSource);
|
||||
} catch (error) {
|
||||
console.dir(error)
|
||||
}
|
||||
});
|
||||
|
||||
onNet(events.CAMERA_FETCH_PHOTOS, async () => {
|
||||
|
||||
Reference in new issue
Block a user