diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-08-09 15:38:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 15:38:00 +0200 |
commit | bb2b64df7a8788e938b6af6de0ba66e3ec1c6b98 (patch) | |
tree | 27fe0ec7726525d1317b9bf48b765736b7e21e48 /apps | |
parent | 93e9d50af638737c6ba6d65489270725fe87e743 (diff) | |
parent | a768f45d25429370875ca12b1705d107669498bd (diff) | |
download | nextcloud-server-bb2b64df7a8788e938b6af6de0ba66e3ec1c6b98.tar.gz nextcloud-server-bb2b64df7a8788e938b6af6de0ba66e3ec1c6b98.zip |
Merge pull request #47150 from nextcloud/backport/47147/stable28
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/newMenu/newFolder.ts | 8 | ||||
-rw-r--r-- | apps/files/src/newMenu/newFromTemplate.ts | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/files/src/newMenu/newFolder.ts b/apps/files/src/newMenu/newFolder.ts index 5d378cab438..f7cdcafee86 100644 --- a/apps/files/src/newMenu/newFolder.ts +++ b/apps/files/src/newMenu/newFolder.ts @@ -65,7 +65,8 @@ export const entry = { async handler(context: Folder, content: Node[]) { const name = await newNodeName(t('files', 'New folder'), content) if (name !== null) { - const { fileid, source } = await createNewFolder(context, name) + const { fileid, source } = await createNewFolder(context, name.trim()) + // Create the folder in the store const folder = new Folder({ source, @@ -82,9 +83,12 @@ export const entry = { }, }) + // Show success + emit('files:node:created', folder) showSuccess(t('files', 'Created new folder "{name}"', { name: basename(source) })) logger.debug('Created new folder', { folder, source }) - emit('files:node:created', folder) + + // Navigate to the new folder window.OCP.Files.Router.goToRoute( null, // use default route { view: 'files', fileid: folder.fileid }, diff --git a/apps/files/src/newMenu/newFromTemplate.ts b/apps/files/src/newMenu/newFromTemplate.ts index 10ff5d630fe..3bb9d3b505e 100644 --- a/apps/files/src/newMenu/newFromTemplate.ts +++ b/apps/files/src/newMenu/newFromTemplate.ts @@ -88,7 +88,7 @@ export function registerTemplateEntries() { if (name !== null) { // Create the file const picker = await templatePicker - picker.open(name, provider) + picker.open(name.trim(), provider) } }, } as Entry) |