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:
parent
466872affb
commit
ea18b31db1
@ -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.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user