Added job select & safe view to camera.
This commit is contained in:
@@ -47,8 +47,10 @@ export function ScreenCamera({ cameraJobId, cameraJob, addPhoto }) {
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const { status } = await Camera.requestPermissionsAsync();
|
||||
setHasPermission(status === "granted");
|
||||
const { status: cameraStatus } = await Camera.requestPermissionsAsync();
|
||||
setHasPermission(cameraStatus === "granted");
|
||||
|
||||
console.log("Camera Perms:", await Camera.getPermissionsAsync());
|
||||
})();
|
||||
}, []);
|
||||
|
||||
@@ -68,7 +70,6 @@ export function ScreenCamera({ cameraJobId, cameraJob, addPhoto }) {
|
||||
skipProcessing: true,
|
||||
};
|
||||
|
||||
console.log("Taking a picture!");
|
||||
let photo = await cameraRef.current.takePictureAsync(options);
|
||||
const filename = photo.uri.substring(photo.uri.lastIndexOf("/") + 1);
|
||||
const newUri = FileSystem.documentDirectory + "photos/" + filename;
|
||||
@@ -78,7 +79,13 @@ export function ScreenCamera({ cameraJobId, cameraJob, addPhoto }) {
|
||||
to: newUri,
|
||||
});
|
||||
setState({ ...state, capturing: false });
|
||||
console.log("Adding photo to cache...");
|
||||
console.log("Add Photo Object", {
|
||||
...photo,
|
||||
id: filename,
|
||||
uri: newUri,
|
||||
jobId: cameraJobId,
|
||||
video: false,
|
||||
});
|
||||
addPhoto({
|
||||
...photo,
|
||||
id: filename,
|
||||
|
||||
Reference in New Issue
Block a user