Switching to create table from data tab no longer marks as dirty

I was getting a confirm() dialog when I clicked outside the dialog on the
create table from data page despite not having filled out any fields.
This commit is contained in:
Simon Willison 2026-06-25 22:35:17 -07:00
commit cb622a3dd6

View file

@ -855,17 +855,12 @@ function tableCreateDialogSignature(state) {
return "";
}
var signature = {
mode: state.mode || "manual",
table: state.tableName.value,
data: state.dataTextarea ? state.dataTextarea.value : "",
dataPrimaryKey: state.dataPkSelect
? state.dataPkSelect.value
: TABLE_CREATE_AUTOMATIC_PK,
};
if (tableCreateIsDataMode(state)) {
signature.previewReady = !!state.dataPreviewReady;
} else {
signature.columns = tableCreateDialogRows(state).map(function (row) {
columns: tableCreateDialogRows(state).map(function (row) {
return {
name: row.querySelector(".table-create-column-name").value,
type: row.querySelector(".table-create-column-type").value,
@ -886,8 +881,8 @@ function tableCreateDialogSignature(state) {
}
).value || "",
};
});
}
}),
};
return JSON.stringify(signature);
}