Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
v0.7: Convert mdtApp.calls to object
Browse files Browse the repository at this point in the history
  • Loading branch information
distritic committed Oct 18, 2020
1 parent 62d58a3 commit db902f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ <h4 v-else-if="warrant_selected.expire_time == null"> ... </h4>

<div v-if="page == 'Calls'" >
<h2 class="page-title">CALL MONITOR</h2>
<h4 v-if="calls.length == 0" style="text-align: center; font-size: 20px; font-weight: bold; margin-top: 20px;">No incoming calls.</h4>
<div style="margin: 0 auto; width: 100%; max-height: 90%; overflow-y: auto; margin-top: 20px;" v-if="calls.length > 0">
<h4 v-if="Object.keys(calls).length == 0" style="text-align: center; font-size: 20px; font-weight: bold; margin-top: 20px;">No incoming calls.</h4>
<div style="margin: 0 auto; width: 100%; max-height: 90%; overflow-y: auto; margin-top: 20px;" v-if="Object.keys(calls).length > 0">
<table style="margin: 0 auto; width: 95%;">
<tr>
<th>#</th>
Expand All @@ -556,7 +556,7 @@ <h4 v-if="calls.length == 0" style="text-align: center; font-size: 20px; font-we
<th>Actions</th>
</tr>
<tr v-for="(call, index) in calls" :key="index">
<td>{{call.id}}</td>
<td>{{index}}</td>
<td>{{call.source}}</td>
<td class="ellipsis"><span>{{call.details}}</span></td>
<td>{{call.time}}</td>
Expand Down
4 changes: 2 additions & 2 deletions ui/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ document.onreadystatechange = () => {
time: time,
officers: []
}
mdtApp.calls.push(call)
Vue.set(mdtApp.calls, event.data.id, call)
} else if (event.data.type == "newCallAttach") {
mdtApp.calls[event.data.call].officers.push(event.data.charname)
} else if (event.data.type == "newCallDetach") {
Expand All @@ -691,7 +691,7 @@ document.onreadystatechange = () => {
location: null
}
}
mdtApp.calls.splice(event.data.call, 1);
Vue.delete(mdtApp.calls, event.data.call)
} else if (event.data.type == "closeModal") {
mdtApp.modal = null;
};
Expand Down

0 comments on commit db902f1

Please sign in to comment.