Add null guards for getElementById and uploadDetail in UploadPage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -452,6 +452,7 @@ onMounted(async () => {
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
const inputElement = document.getElementById("fileNameInput");
|
||||
if (!inputElement) return;
|
||||
const baseWidth = 20;
|
||||
const textWidth = getTextWidth(fileName.value, inputElement);
|
||||
inputElement.style.width = baseWidth + textWidth + "px";
|
||||
@@ -461,10 +462,12 @@ onMounted(async () => {
|
||||
);
|
||||
showEdit.value = true;
|
||||
if (uploadId.value) await filesStore.getUploadDetail();
|
||||
if (uploadDetail.value?.columns) {
|
||||
selectedColumns.value = Array.from(
|
||||
{ length: uploadDetail.value.columns.length },
|
||||
() => columnType[columnType.length - 1],
|
||||
); // Default to "Not Assigned"
|
||||
}
|
||||
unwatch();
|
||||
isLoading.value = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user