Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
ololokiras committed Nov 29, 2018
1 parent cc0decb commit 5d2c91a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/modules/acc/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const getters = {
return nonZeroBalances;
},
isLocked: state => {
return !state.wallet.aesPrivate && (!state.keys.active || !state.keys.owner);;
return !state.wallet.aesPrivate && (!state.keys.active || !state.keys.owner);
},
isLoggedIn: state => !!state.userId,
isValidPassword: state => {
Expand Down
16 changes: 9 additions & 7 deletions src/modules/operations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Vue from 'vue';
import { ChainTypes } from 'bitsharesjs';
import * as types from '../mutations';
import API from '../services/api';
import Subscriptions from '../services/api/subscriptions';
Expand Down Expand Up @@ -100,10 +99,10 @@ const actions = {
const getters = {
getOperations: state => state.list,
getActiveOrders: state => {
const openOrders = state.list.filter(x => x.type === 'limit_order_create');
const cancelOrders = state.list.filter(x => x.type === 'limit_order_cancel');
const openedOrder = state.list.filter(x => x.type === 'limit_order_create');
const canceledOrders = state.list.filter(x => x.type === 'limit_order_cancel');
const filledOrders = state.list.filter(x => x.type === 'fill_order');
const notCanceledOrders = openOrders.filter(x => !cancelOrders.some(y => y.orderId === x.orderId));
const notCanceledOrders = openedOrder.filter(x => !canceledOrders.some(y => y.orderId === x.orderId));
notCanceledOrders.forEach(notCancelOrder => {
let percentFilled = 0;
filledOrders.forEach(filledOrder => {
Expand All @@ -112,15 +111,18 @@ const getters = {
percentFilled = +(
((notCancelOrder.payload.amount_to_sell.amount - remain)
/ notCancelOrder.payload.amount_to_sell.amount)
* 100)
.toFixed(2);
* 100);
}
});
if (percentFilled < 100) {
notCancelOrder.percentFilled = percentFilled;
}
});
const activeOrders = notCanceledOrders.filter(x => x.hasOwnProperty('percentFilled'));


const activeOrders = notCanceledOrders.filter(
x => Object.prototype.hasOwnProperty.call(x, 'percentFilled')
);
return activeOrders;
},
isFetching: state => state.pending,
Expand Down
2 changes: 1 addition & 1 deletion src/services/api/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Operations = {
}

if (operationType === 'limit_order_create') {
orderId = operation.result[1];
[, orderId] = operation.result;
}

if (operationType === 'limit_order_cancel') {
Expand Down

0 comments on commit 5d2c91a

Please sign in to comment.