🎛️ Update FileSelector to use computed activeFilesState with default props
This commit is contained in:
@@ -35,10 +35,17 @@ import { useGamemasterFiles } from '../../composables/useGamemasterFiles.js';
|
||||
const props = defineProps({
|
||||
client: {
|
||||
type: Object,
|
||||
required: true
|
||||
default: null
|
||||
},
|
||||
filesState: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
const internalFilesState = useGamemasterFiles(props.client);
|
||||
const activeFilesState = computed(() => props.filesState || internalFilesState);
|
||||
|
||||
const {
|
||||
selectedFile,
|
||||
fileContent,
|
||||
@@ -50,7 +57,7 @@ const {
|
||||
formatSize,
|
||||
formatFileName,
|
||||
getFileType
|
||||
} = useGamemasterFiles(props.client);
|
||||
} = activeFilesState.value;
|
||||
|
||||
const selectedFileMeta = computed(() => {
|
||||
if (!selectedFile.value) return null;
|
||||
|
||||
Reference in New Issue
Block a user