summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorMarco Rodolfi <marco.rodolfi@tuta.io>2023-06-26 08:53:41 +0200
committerMarco Rodolfi <marco.rodolfi@tuta.io>2023-06-26 08:53:41 +0200
commit3e64e53cd724773c4616b178fd695091f9a7c71a (patch)
treeea2d87e2c5b6cac409113842d89c850b848eac1e /frontend
parentef9afa8cbca29a3dd83454f44264a4682e968c59 (diff)
downloaddecky-loader-3e64e53cd724773c4616b178fd695091f9a7c71a.tar.gz
decky-loader-3e64e53cd724773c4616b178fd695091f9a7c71a.zip
feat: Added detailed message for permission error and clean up english language from unused strings.
Diffstat (limited to 'frontend')
-rw-r--r--frontend/i18next-parser.config.mjs2
-rw-r--r--frontend/src/components/modals/filepicker/FilePickerError.tsx7
-rw-r--r--frontend/src/components/modals/filepicker/index.tsx3
3 files changed, 10 insertions, 2 deletions
diff --git a/frontend/i18next-parser.config.mjs b/frontend/i18next-parser.config.mjs
index 9d4b114d..8de58cfc 100644
--- a/frontend/i18next-parser.config.mjs
+++ b/frontend/i18next-parser.config.mjs
@@ -36,7 +36,7 @@ export default {
lineEnding: 'auto',
// Control the line ending. See options at https://github.com/ryanve/eol
- locales: ['en-US', 'it-IT'],
+ locales: ['en-US'],
// An array of the locales in your applications
namespaceSeparator: false,
diff --git a/frontend/src/components/modals/filepicker/FilePickerError.tsx b/frontend/src/components/modals/filepicker/FilePickerError.tsx
index bf75afae..f2330b9a 100644
--- a/frontend/src/components/modals/filepicker/FilePickerError.tsx
+++ b/frontend/src/components/modals/filepicker/FilePickerError.tsx
@@ -1,10 +1,11 @@
import { FC, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { IconContext } from 'react-icons';
-import { FaExclamationTriangle, FaQuestionCircle } from 'react-icons/fa';
+import { FaExclamationTriangle, FaQuestionCircle, FaUserSlash } from 'react-icons/fa';
export enum FileErrorTypes {
FileNotFound,
+ PermissionDenied,
Unknown,
None,
}
@@ -25,6 +26,10 @@ const FilePickerError: FC<FilePickerErrorProps> = ({ error, rawError = null }) =
setText(t('FilePickerError.errors.file_not_found'));
setIcon(<FaExclamationTriangle />);
break;
+ case FileErrorTypes.PermissionDenied:
+ setText(t('FilePickerError.errors.perm_denied'));
+ setIcon(<FaUserSlash />);
+ break;
case FileErrorTypes.Unknown:
setText(t('FilePickerError.errors.unknown', { raw_error: rawError }));
setIcon(<FaQuestionCircle />);
diff --git a/frontend/src/components/modals/filepicker/index.tsx b/frontend/src/components/modals/filepicker/index.tsx
index 50931358..ae745c9c 100644
--- a/frontend/src/components/modals/filepicker/index.tsx
+++ b/frontend/src/components/modals/filepicker/index.tsx
@@ -210,6 +210,9 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
case theError.match(/\[WinError\s3.*/i)?.input:
setError(FileErrorTypes.FileNotFound);
break;
+ case theError.match(/\[Errno\s13.*/i)?.input:
+ setError(FileErrorTypes.PermissionDenied);
+ break;
default:
setRawError(theError);
setError(FileErrorTypes.Unknown);