Commit 96d4f491 authored by okhin's avatar okhin 🚴

Adding some feedback

parent 41a645e6
Pipeline #776 passed with stage
in 1 second
......@@ -131,9 +131,9 @@
$('#step5').addClass('red');
$('#step6').addClass('red');
$('#step_connected').addClass('visible');
window.clearInterval(intervall);
};
};
console.log(call_state[0]);
};
function fetch() {
$.ajax({
......
<script>
var call = JSON.parse("{{ @call | raw }}");
function update_call(call) {
var call_url = call['data']['call_url'];
var call_history = call['data']['history'];
// call_states is now a list of states, each of them is a
// tuple of the form 'state, date'
// getting the current state is a matter of sorting this list of
// tuple on the second element of the tuple
call_state = call_history.sort(function(a, b) {
var date1 = new Date(a[1]);
var date2 = new Date(b[1]);
return date1 - date2;
})[0];
console.log(call_state);
};
$(document).ready(update_call);
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment