Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Fix stupidly explicit expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Apr 9, 2022
1 parent d8ac9d8 commit b7c5b74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
17 changes: 5 additions & 12 deletions pages/FilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FilePage: React.FC = () => {
const permissionResult =
await ImagePicker.requestMediaLibraryPermissionsAsync();

if (permissionResult.granted === false) {
if (!permissionResult.granted) {
Notifier.showNotification({
title: "Permission to access the camera roll is required!",
Component: NotifierComponents.Alert,
Expand All @@ -62,11 +62,8 @@ const FilePage: React.FC = () => {
mediaTypes: ImagePicker.MediaTypeOptions.All,
});

if (pickerResult.cancelled === true) {
file = null;
} else {
file = pickerResult;
}
file = pickerResult.cancelled ? null : pickerResult;

} else if (action === "document") {
const res = await DocumentPicker.getDocumentAsync();
if (res.type !== "cancel") {
Expand All @@ -77,7 +74,7 @@ const FilePage: React.FC = () => {
} else if (action === "camera") {
const permissionResult = await ImagePicker.getCameraPermissionsAsync();

if (permissionResult.granted === false) {
if (!permissionResult.granted) {
Notifier.showNotification({
title: "Permission to access the camera is required!",
Component: NotifierComponents.Alert,
Expand All @@ -96,11 +93,7 @@ const FilePage: React.FC = () => {
: Settings.get("uploadquality"),
});

if (pickerResult.cancelled === true) {
file = null;
} else {
file = pickerResult;
}
file = pickerResult.cancelled ? null : pickerResult;
}

if (file !== null) {
Expand Down
2 changes: 1 addition & 1 deletion pages/QRScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const QRScreen: React.FC = () => {
return <Text>Requesting for camera permission</Text>;
}

if (hasPermission === false) {
if (!hasPermission) {
return <Text>No access to camera</Text>;
}

Expand Down

0 comments on commit b7c5b74

Please sign in to comment.