Fixed tab issues & added gallery view IO-397 IO-398
This commit is contained in:
@@ -55,16 +55,17 @@ export function ScreenCamera({ cameraJobId, cameraJob, addPhoto }) {
|
||||
};
|
||||
|
||||
let photo = await cameraRef.current.takePictureAsync(options);
|
||||
setState({ ...state, capturing: false });
|
||||
|
||||
console.log("ScreenCamera -> photo", photo);
|
||||
const filename = photo.uri.substring(photo.uri.lastIndexOf("/") + 1);
|
||||
|
||||
const newUri = FileSystem.documentDirectory + "photos/" + filename;
|
||||
|
||||
await FileSystem.copyAsync({
|
||||
await FileSystem.moveAsync({
|
||||
from: photo.uri,
|
||||
to: newUri,
|
||||
});
|
||||
setState({ ...state, capturing: false });
|
||||
|
||||
addPhoto({
|
||||
...photo,
|
||||
@@ -80,15 +81,15 @@ export function ScreenCamera({ cameraJobId, cameraJob, addPhoto }) {
|
||||
console.log("Taking a video!");
|
||||
if (cameraRef.current) {
|
||||
let video = await cameraRef.current.recordAsync();
|
||||
setState({ ...state, capturing: false });
|
||||
|
||||
const filename = video.uri.substring(video.uri.lastIndexOf("/") + 1);
|
||||
const newUri = FileSystem.documentDirectory + "photos/" + filename;
|
||||
|
||||
await FileSystem.copyAsync({
|
||||
await FileSystem.moveAsync({
|
||||
from: video.uri,
|
||||
to: newUri,
|
||||
});
|
||||
setState({ ...state, capturing: false });
|
||||
|
||||
addPhoto({
|
||||
...video,
|
||||
|
||||
Reference in New Issue
Block a user