mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) FormulaEditor was updating formula when nothing has changed
Summary: FormulaEditor on sidepanel was sending update action when formula wasn't updated by the user. Test Plan: Existing tests Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3545
This commit is contained in:
parent
aeba738f7c
commit
364715eba3
@ -293,12 +293,17 @@ export function openFormulaEditor(options: {
|
|||||||
// AsyncOnce ensures it's called once even if triggered multiple times.
|
// AsyncOnce ensures it's called once even if triggered multiple times.
|
||||||
const saveEdit = asyncOnce(async () => {
|
const saveEdit = asyncOnce(async () => {
|
||||||
const formula = editor.getCellValue();
|
const formula = editor.getCellValue();
|
||||||
|
if (formula !== column.formula.peek()) {
|
||||||
if (options.onSave) {
|
if (options.onSave) {
|
||||||
await options.onSave(column, formula as string);
|
await options.onSave(column, formula as string);
|
||||||
} else if (formula !== column.formula.peek()) {
|
} else {
|
||||||
await column.updateColValues({formula});
|
await column.updateColValues({formula});
|
||||||
}
|
}
|
||||||
holder.dispose();
|
holder.dispose();
|
||||||
|
} else {
|
||||||
|
holder.dispose();
|
||||||
|
options.onCancel?.();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// These are the commands for while the editor is active.
|
// These are the commands for while the editor is active.
|
||||||
|
Loading…
Reference in New Issue
Block a user