From a5592f3857949ef55e5e5b4a8728cb2a27410023 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Thu, 29 Jan 2026 04:27:27 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Refactor=20computed=20properties?= =?UTF-8?q?=20and=20method=20bindings=20for=20improved=20readability=20and?= =?UTF-8?q?=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/gamemaster/FileSelector.vue | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/code/websites/pokedex.online/src/components/gamemaster/FileSelector.vue b/code/websites/pokedex.online/src/components/gamemaster/FileSelector.vue index 086bb09..6bd5e31 100644 --- a/code/websites/pokedex.online/src/components/gamemaster/FileSelector.vue +++ b/code/websites/pokedex.online/src/components/gamemaster/FileSelector.vue @@ -46,28 +46,26 @@ const props = defineProps({ const internalFilesState = useGamemasterFiles(props.client); const activeFilesState = computed(() => props.filesState || internalFilesState); -const { - selectedFile, - fileContent, - fileLines, - uniqueFiles, - isLoading, - fileError, - loadStatus, - formatSize, - formatFileName, - getFileType -} = activeFilesState.value; +const selectedFile = computed(() => activeFilesState.value.selectedFile); +const fileContent = computed(() => activeFilesState.value.fileContent); +const fileLines = computed(() => activeFilesState.value.fileLines); +const uniqueFiles = computed(() => activeFilesState.value.uniqueFiles); +const isLoading = computed(() => activeFilesState.value.isLoading); +const fileError = computed(() => activeFilesState.value.fileError); + +const formatSize = (...args) => activeFilesState.value.formatSize(...args); +const formatFileName = (...args) => activeFilesState.value.formatFileName(...args); +const getFileType = (...args) => activeFilesState.value.getFileType(...args); const selectedFileMeta = computed(() => { - if (!selectedFile.value) return null; - return uniqueFiles.value.find( - file => getFileType(file.filename) === selectedFile.value + if (!selectedFile.value.value) return null; + return uniqueFiles.value.value.find( + file => getFileType(file.filename) === selectedFile.value.value ); }); onMounted(() => { - loadStatus(); + activeFilesState.value.loadStatus(); });