Просмотр исходного кода

Fix optional chaining for file extension retrieval in EditorSwitch

GitOrigin-RevId: 9aeee2f856c4f4dadc38affecc06179b61267af0
Domagoj Kriskovic 7 месяцев назад
Родитель
Сommit
f078929b25

+ 1 - 1
services/web/frontend/js/features/source-editor/components/editor-switch.tsx

@@ -17,7 +17,7 @@ function EditorSwitch() {
   const richTextAvailable = openDocName
     ? isVisualEditorAvailable(openDocName)
     : false
-  const extension = getFileExtension(openDocName || '')
+  const extension = getFileExtension(openDocName || '') ?? ''
 
   const handleChange = useCallback(
     (event: ChangeEvent<HTMLInputElement>) => {