🎨 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 selectedFile = computed({
|
||||
get: () => activeFilesState.value?.selectedFile?.value,
|
||||
set: (val) => {
|
||||
set: val => {
|
||||
if (activeFilesState.value?.selectedFile) {
|
||||
activeFilesState.value.selectedFile.value = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
const fileContent = computed(() => activeFilesState.value?.fileContent?.value);
|
||||
const fileLines = computed(() => activeFilesState.value?.fileLines?.value || []);
|
||||
const uniqueFiles = computed(() => activeFilesState.value?.uniqueFiles?.value || []);
|
||||
const isLoading = computed(() => activeFilesState.value?.isLoading?.value || false);
|
||||
const fileLines = computed(
|
||||
() => activeFilesState.value?.fileLines?.value || []
|
||||
);
|
||||
const uniqueFiles = computed(
|
||||
() => activeFilesState.value?.uniqueFiles?.value || []
|
||||
);
|
||||
const isLoading = computed(
|
||||
() => activeFilesState.value?.isLoading?.value || false
|
||||
);
|
||||
const fileError = computed(() => activeFilesState.value?.fileError?.value);
|
||||
|
||||
const formatSize = (...args) => activeFilesState.value?.formatSize?.(...args);
|
||||
|
||||
Reference in New Issue
Block a user