1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Small style changes for Piece and Edition ListStores

This commit is contained in:
Brett Sun 2016-01-13 17:14:09 +01:00
parent 466872affb
commit ea18b31db1
2 changed files with 14 additions and 15 deletions

View File

@ -60,7 +60,7 @@ class PieceListStore {
* point anyway. Then, this problem is automatically resolved.
*/
pieceList.forEach((piece, i) => {
let oldPiece = this.pieceList[i];
const oldPiece = this.pieceList[i];
if (oldPiece) {
piece = React.addons.update(piece, {
show: { $set: oldPiece.show }
@ -77,11 +77,10 @@ class PieceListStore {
}
onUpdatePropertyForPiece({ pieceId, key, value }) {
let filteredPieceList = this.pieceList.filter((piece) => piece.id === pieceId);
const filteredPieceList = this.pieceList.filter((piece) => piece.id === pieceId);
if (filteredPieceList.length === 1) {
let piece = filteredPieceList[0];
const piece = filteredPieceList[0];
piece[key] = value;
} else {
throw new Error('Could not find a matching piece in piece list since its either not there or piecelist contains duplicates.');