From 60ab01b0c8a89c0103317587bb4c79f14b46b493 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 18 May 2025 16:36:20 +0200 Subject: [PATCH] Fix type-check issues --- app/src/components/editor/MarkdownPreview.tsx | 7 +++--- .../components/modals/user/EditUserModal.tsx | 8 +++---- .../navigation/WorkspaceSwitcher.tsx | 2 +- .../settings/account/AccountSettings.tsx | 8 +++---- .../settings/workspace/AppearanceSettings.tsx | 2 -- .../settings/workspace/DangerZoneSettings.tsx | 2 +- .../settings/workspace/WorkspaceSettings.tsx | 1 - app/src/contexts/WorkspaceContext.tsx | 7 ++---- app/src/hooks/useAdminData.ts | 9 ++++---- app/src/hooks/useGitOperations.ts | 11 +++++----- app/src/utils/remarkWikiLinks.ts | 22 ++++++++++++++----- 11 files changed, 41 insertions(+), 38 deletions(-) diff --git a/app/src/components/editor/MarkdownPreview.tsx b/app/src/components/editor/MarkdownPreview.tsx index ebbe6e6..9e8e2be 100644 --- a/app/src/components/editor/MarkdownPreview.tsx +++ b/app/src/components/editor/MarkdownPreview.tsx @@ -55,7 +55,9 @@ const MarkdownPreview: React.FC = ({ const [filePath] = decodeURIComponent( href.replace(`${baseUrl}/internal/`, '') ).split('#'); - handleFileSelect(filePath); + if (filePath) { + handleFileSelect(filePath); + } } else if (href.startsWith(`${baseUrl}/notfound/`)) { // For non-existent files, show a notification const fileName = decodeURIComponent( @@ -105,9 +107,6 @@ const MarkdownPreview: React.FC = ({ ), code: ({ children, className, ...props }: MarkdownCodeProps) => { - const language = className - ? className.replace('language-', '') - : null; return (
                 {children}
diff --git a/app/src/components/modals/user/EditUserModal.tsx b/app/src/components/modals/user/EditUserModal.tsx
index c3e8719..db2f129 100644
--- a/app/src/components/modals/user/EditUserModal.tsx
+++ b/app/src/components/modals/user/EditUserModal.tsx
@@ -30,7 +30,7 @@ const EditUserModal: React.FC = ({
   const [formData, setFormData] = useState({
     email: '',
     displayName: '',
-    role: undefined,
+    role: UserRole.Editor,
     password: '',
   });
 
@@ -58,7 +58,7 @@ const EditUserModal: React.FC = ({
       setFormData({
         email: '',
         displayName: '',
-        role: undefined,
+        role: UserRole.Editor,
         password: '',
       });
       onClose();
@@ -88,9 +88,9 @@ const EditUserModal: React.FC = ({