🎨 Reformat computed properties and conditional assignments for improved readability
This commit is contained in:
@@ -43,21 +43,29 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const internalFilesState = props.client ? useGamemasterFiles(props.client) : null;
|
const internalFilesState = props.client
|
||||||
|
? useGamemasterFiles(props.client)
|
||||||
|
: null;
|
||||||
const activeFilesState = computed(() => props.filesState || internalFilesState);
|
const activeFilesState = computed(() => props.filesState || internalFilesState);
|
||||||
|
|
||||||
const selectedFile = computed({
|
const selectedFile = computed({
|
||||||
get: () => activeFilesState.value?.selectedFile?.value,
|
get: () => activeFilesState.value?.selectedFile?.value,
|
||||||
set: (val) => {
|
set: val => {
|
||||||
if (activeFilesState.value?.selectedFile) {
|
if (activeFilesState.value?.selectedFile) {
|
||||||
activeFilesState.value.selectedFile.value = val;
|
activeFilesState.value.selectedFile.value = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const fileContent = computed(() => activeFilesState.value?.fileContent?.value);
|
const fileContent = computed(() => activeFilesState.value?.fileContent?.value);
|
||||||
const fileLines = computed(() => activeFilesState.value?.fileLines?.value || []);
|
const fileLines = computed(
|
||||||
const uniqueFiles = computed(() => activeFilesState.value?.uniqueFiles?.value || []);
|
() => activeFilesState.value?.fileLines?.value || []
|
||||||
const isLoading = computed(() => activeFilesState.value?.isLoading?.value || false);
|
);
|
||||||
|
const uniqueFiles = computed(
|
||||||
|
() => activeFilesState.value?.uniqueFiles?.value || []
|
||||||
|
);
|
||||||
|
const isLoading = computed(
|
||||||
|
() => activeFilesState.value?.isLoading?.value || false
|
||||||
|
);
|
||||||
const fileError = computed(() => activeFilesState.value?.fileError?.value);
|
const fileError = computed(() => activeFilesState.value?.fileError?.value);
|
||||||
|
|
||||||
const formatSize = (...args) => activeFilesState.value?.formatSize?.(...args);
|
const formatSize = (...args) => activeFilesState.value?.formatSize?.(...args);
|
||||||
|
|||||||
Reference in New Issue
Block a user