diff --git a/components/kaburi.jsx b/components/kaburi.jsx index dc7b0cf..b8d494f 100644 --- a/components/kaburi.jsx +++ b/components/kaburi.jsx @@ -1,7 +1,6 @@ export default ({ activity }) => { - const kaburiActivity = activity.filter(a => a.ch === "kaburi"); - const count = kaburiActivity.length; - const time = kaburiActivity + const count = activity.length; + const time = activity .map(a => a.endTime - a.startTime) .reduce((a, c) => a + c, 0); diff --git a/components/vad.jsx b/components/vad.jsx index c1de31f..257444e 100644 --- a/components/vad.jsx +++ b/components/vad.jsx @@ -9,7 +9,8 @@ export default class extends Component { audioStream: null, left: null, right: null, - activity: [] + activity: [], + kaburiActivity: [] }; componentDidMount() { @@ -30,10 +31,9 @@ export default class extends Component { const putKaburi = () => { if (this.state.left !== null && this.state.right !== null) { this.setState({ - activity: [ - ...this.state.activity, + kaburiActivity: [ + ...this.state.kaburiActivity, { - ch: "kaburi", startTime: Math.max(this.state.left, this.state.right), endTime: new Date().getTime() } @@ -111,7 +111,7 @@ export default class extends Component {