diff --git a/changelog/unreleased/bugfix-created-file-missing-file-extension b/changelog/unreleased/bugfix-created-file-missing-file-extension new file mode 100644 index 00000000000..cb008c36af8 --- /dev/null +++ b/changelog/unreleased/bugfix-created-file-missing-file-extension @@ -0,0 +1,8 @@ +Bugfix: Created file missing extension when file extensions not shown is active + +We've fixed a bug where the file extension was missing, +when the user set the file extensions not shown configuration option. +This affected files that are handled via external applications, for example Microsoft Excel. + +https://github.com/owncloud/web/issues/10170 +https://github.com/owncloud/web/pull/10169 diff --git a/packages/web-app-files/src/composables/actions/files/useFileActionsCreateNewFile.ts b/packages/web-app-files/src/composables/actions/files/useFileActionsCreateNewFile.ts index cbaaabc44c7..630e2a67b1f 100644 --- a/packages/web-app-files/src/composables/actions/files/useFileActionsCreateNewFile.ts +++ b/packages/web-app-files/src/composables/actions/files/useFileActionsCreateNewFile.ts @@ -195,14 +195,17 @@ export const useFileActionsCreateNewFile = ({ ), inputSelectionRange, onCancel: () => store.dispatch('hideModal'), - onConfirm: !openAction - ? addAppProviderFileFunc - : (fileName) => { - if (!areFileExtensionsShown.value) { - fileName = `${fileName}.${extension}` - } - addNewFile(fileName, openAction) - }, + onConfirm: (fileName: string) => { + if (!areFileExtensionsShown.value) { + fileName = `${fileName}.${extension}` + } + + if (!openAction) { + return addAppProviderFileFunc(fileName) + } + + return addNewFile(fileName, openAction) + }, onInput: checkInputValue }