File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/internal-packages/crud/lib/component Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
const _ = require ( 'lodash' ) ;
2
2
const React = require ( 'react' ) ;
3
+ const uuid = require ( 'node-uuid' ) ;
3
4
const app = require ( 'ampersand-app' ) ;
4
5
const Action = require ( 'hadron-action' ) ;
5
6
const ObjectID = require ( 'bson' ) . ObjectID ;
@@ -191,12 +192,10 @@ class DocumentList extends React.Component {
191
192
/**
192
193
* Get the key for a doc.
193
194
*
194
- * @param {Document } doc - The document.
195
- *
196
195
* @returns {String } The unique key.
197
196
*/
198
- _key ( doc ) {
199
- return ` ${ NamespaceStore . ns } _ ${ JSON . stringify ( doc . _id ) } ` ;
197
+ _key ( ) {
198
+ return uuid . v4 ( ) ;
200
199
}
201
200
202
201
/**
@@ -222,7 +221,7 @@ class DocumentList extends React.Component {
222
221
renderDocuments ( docs ) {
223
222
return _ . map ( docs , ( doc ) => {
224
223
return (
225
- < li className = "document-list-item" key = { this . _key ( doc ) } >
224
+ < li className = "document-list-item" key = { this . _key ( ) } >
226
225
< Document doc = { doc } key = { this . _key ( doc ) } editable />
227
226
</ li >
228
227
) ;
You can’t perform that action at this time.
0 commit comments