From dc609301d7d4596c207b30676cc71df748739710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Thu, 12 Dec 2024 13:29:39 +0100 Subject: [PATCH] pkp/pkp-lib#10684 Fix FileManager to respond to changes in props correctly --- src/managers/FileManager/fileManagerStore.js | 8 ++++---- src/managers/FileManager/useFileManagerConfig.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/managers/FileManager/fileManagerStore.js b/src/managers/FileManager/fileManagerStore.js index a7868d363..b0e893058 100644 --- a/src/managers/FileManager/fileManagerStore.js +++ b/src/managers/FileManager/fileManagerStore.js @@ -1,6 +1,6 @@ import {defineComponentStore} from '@/utils/defineComponentStore'; -import {ref, computed, watch} from 'vue'; +import {ref, computed, watch, toRefs} from 'vue'; import {useFetch} from '@/composables/useFetch'; import {useUrl} from '@/composables/useUrl'; import {useFileManagerActions} from './useFileManagerActions'; @@ -10,13 +10,13 @@ export const useFileManagerStore = defineComponentStore( 'fileManager', (props) => { const submissionId = ref(props.submission.id); - + const {namespace, submissionStageId} = toRefs(props); /** * Manager configuration */ const {managerConfig} = useFileManagerConfig({ - namespace: props.namespace, - submissionStageId: props.submissionStageId, + namespace: namespace, + submissionStageId: submissionStageId, }); /** diff --git a/src/managers/FileManager/useFileManagerConfig.js b/src/managers/FileManager/useFileManagerConfig.js index cf6c0df4c..9a867bd19 100644 --- a/src/managers/FileManager/useFileManagerConfig.js +++ b/src/managers/FileManager/useFileManagerConfig.js @@ -236,8 +236,8 @@ export function useFileManagerConfig({namespace, submissionStageId}) { const {hasCurrentUserAtLeastOneRole} = useCurrentUser(); const managerConfig = computed(() => { - const config = FileManagerConfigurations[namespace]({ - stageId: submissionStageId, + const config = FileManagerConfigurations[namespace.value]({ + stageId: submissionStageId.value, }); const permittedActions = config.actions.filter((action) => {