aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0x85FB9C51 <77808164+0x85FB9C51@users.noreply.github.com>2021-07-01 17:08:57 -0400
committer0x85FB9C51 <77808164+0x85FB9C51@users.noreply.github.com>2021-07-01 17:08:57 -0400
commitbe53a5a9122d0a6caa27810e34544578abb4c573 (patch)
tree44f41ab2a4f232bc949bc5b9467348b054dfab31 /src
parent48640698459e073118a8a36d5428639c88cb6864 (diff)
fixed minor bug that prevented strings in quotes from being saved
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 42c5375ce..e9c5c009f 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -249,11 +249,10 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
if (isNaN(parseInt(s))) {
inputIsNum = false;
}
- console.log(inputIsNum);
}
// check if the input is a boolean
let inputIsBool: boolean = value == "false" || value == "true";
-
+ // what to do in the case
if (!inputIsNum && !inputIsBool && !value.startsWith("=")) {
// if it's not a number, it's a string, and should be processed as such
// strips the string of quotes when it is edited to prevent quotes form being added to the text automatically
@@ -278,7 +277,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
inputAsString += '"';
//two options here: we can strip off outer quotes or we can figure out what's going on with the script
const script = CompileScript(inputAsString, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } });
- script.compiled && (retVal = this.applyToDoc(inputAsString.length !== value.length ? this._rowDoc : this._rowDataDoc, this.props.row, this.props.col, script.run));
+ script.compiled && (retVal = this.applyToDoc((inputAsString.length !== value.length || inputAsString.length - 2 !== value.length) ? this._rowDoc : this._rowDataDoc, this.props.row, this.props.col, script.run));
// handle numbers and expressions
} else if (inputIsNum || value.startsWith("=")) {
//TODO: make accept numbers