aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/store/renaming.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/store/renaming.ts')
-rw-r--r--apps/files/src/store/renaming.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files/src/store/renaming.ts b/apps/files/src/store/renaming.ts
index 2ac9e06ba16..fc61be3bd3b 100644
--- a/apps/files/src/store/renaming.ts
+++ b/apps/files/src/store/renaming.ts
@@ -14,6 +14,7 @@ import { defineStore } from 'pinia'
import logger from '../logger'
import Vue, { defineAsyncComponent, ref } from 'vue'
import { useUserConfigStore } from './userconfig'
+import { fetchNode } from '../services/WebdavClient'
export const useRenamingStore = defineStore('renaming', () => {
/**
@@ -48,7 +49,7 @@ export const useRenamingStore = defineStore('renaming', () => {
}
isRenaming.value = true
- const node = renamingNode.value
+ let node = renamingNode.value
Vue.set(node, 'status', NodeStatus.LOADING)
const userConfig = useUserConfigStore()
@@ -86,6 +87,13 @@ export const useRenamingStore = defineStore('renaming', () => {
},
})
+ // Update mime type if extension changed
+ // as other related informations might have changed
+ // on the backend but it is really hard to know on the front
+ if (oldExtension !== newExtension) {
+ node = await fetchNode(node.path)
+ }
+
// Success 🎉
emit('files:node:updated', node)
emit('files:node:renamed', node)