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 11const _ = require ( 'lodash' ) ;
22const React = require ( 'react' ) ;
3+ const uuid = require ( 'node-uuid' ) ;
34const app = require ( 'ampersand-app' ) ;
45const Action = require ( 'hadron-action' ) ;
56const ObjectID = require ( 'bson' ) . ObjectID ;
@@ -191,12 +192,10 @@ class DocumentList extends React.Component {
191192 /**
192193 * Get the key for a doc.
193194 *
194- * @param {Document } doc - The document.
195- *
196195 * @returns {String } The unique key.
197196 */
198- _key ( doc ) {
199- return ` ${ NamespaceStore . ns } _ ${ JSON . stringify ( doc . _id ) } ` ;
197+ _key ( ) {
198+ return uuid . v4 ( ) ;
200199 }
201200
202201 /**
@@ -222,7 +221,7 @@ class DocumentList extends React.Component {
222221 renderDocuments ( docs ) {
223222 return _ . map ( docs , ( doc ) => {
224223 return (
225- < li className = "document-list-item" key = { this . _key ( doc ) } >
224+ < li className = "document-list-item" key = { this . _key ( ) } >
226225 < Document doc = { doc } key = { this . _key ( doc ) } editable />
227226 </ li >
228227 ) ;
You can’t perform that action at this time.
0 commit comments