Skip to content

Commit 002f36f

Browse files
committed
Do not show invalid pointers after commiting a change in an array or object field
1 parent 9bc832d commit 002f36f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed
+5-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
22
"apps": [{
3-
"serverURL": "http://localhost:1338/parse",
4-
"appId": "hello",
5-
"masterKey": "world",
6-
"appName": "",
7-
"iconName": "",
8-
"primaryBackgroundColor": "",
9-
"secondaryBackgroundColor": ""
10-
}],
11-
"iconsFolder": "icons"
3+
"serverURL": "http://localhost:1337/parse",
4+
"appId": "APPLICATION_ID",
5+
"masterKey": "MASTER_KEY",
6+
"appName": "MyAppName"
7+
}]
128
}

src/dashboard/Data/Browser/Editor.react.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FileEditor from 'components/FileEditor/FileEditor.react';
1212
import GeoPointEditor from 'components/GeoPointEditor/GeoPointEditor.react';
1313
import NumberEditor from 'components/NumberEditor/NumberEditor.react';
1414
import Parse from 'parse';
15+
import decode from 'parse/lib/browser/decode';
1516
import React from 'react';
1617
import StringEditor from 'components/StringEditor/StringEditor.react';
1718

@@ -30,7 +31,7 @@ let Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit }
3031
} else if (type === 'Array' || type === 'Object') {
3132
let encodeCommit = (json) => {
3233
try {
33-
let obj = JSON.parse(json);
34+
let obj = decode(JSON.parse(json));
3435
onCommit(obj);
3536
} catch (e) {
3637
onCommit(value);

0 commit comments

Comments
 (0)