removes unnecessary if/else nesting
@@ -289,11 +289,9 @@ export function hintMessageReceived(event) {
//first check if we really have the 'own' need in the state - otherwise we'll ignore the hint
if (!getState().getIn(['needs', event.getReceiverNeed()])) {
console.log("ignoring hint for a need that is not ours:", event.getReceiverNeed());
- } else {
- if(getState().getIn(['needs', event.getMatchCounterpart(), 'state']) === won.WON.InactiveCompacted) {
+ } else if(getState().getIn(['needs', event.getMatchCounterpart(), 'state']) === won.WON.InactiveCompacted) {
console.log("ignoring hint for an inactive need:", event.getMatchCounterpart());
} else {
-
//event.eventType = won.messageType2EventType[event.hasMessageType]; TODO needed?
won.invalidateCacheForNewConnection(event.getReceiver(), event.getReceiverNeed())
.then(() => {
@@ -329,4 +327,3 @@ export function hintMessageReceived(event) {
}
}
}
-}
