Fixed tab issues & added gallery view IO-397 IO-398

This commit is contained in:
Patrick Fic
2020-11-17 15:13:35 -08:00
parent cd5f8af9e4
commit 8fc357a6d9
10 changed files with 175 additions and 34 deletions

View File

@@ -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,