* VRFS-2808 - prevent duplicate attempt to open recording
This commit is contained in:
parent
9d70400e91
commit
ea482da0dc
|
|
@ -7,6 +7,7 @@
|
|||
var rest = context.JK.Rest();
|
||||
var showing = false;
|
||||
var perPage = 10;
|
||||
var openingRecording = false;
|
||||
|
||||
function tbody() {
|
||||
return $('#local-recordings-dialog table.local-recordings tbody');
|
||||
|
|
@ -22,6 +23,7 @@
|
|||
|
||||
|
||||
function beforeShow() {
|
||||
openingRecording = false;
|
||||
emptyList();
|
||||
resetPagination();
|
||||
showing = true;
|
||||
|
|
@ -89,6 +91,12 @@
|
|||
function registerStaticEvents() {
|
||||
$('#local-recordings-dialog table.local-recordings tbody').on('click', 'tr', function(e) {
|
||||
|
||||
if(openingRecording) {
|
||||
// prevent double-click spam
|
||||
logger.debug("localRecordingDialog: ignoring duplicate open attempt")
|
||||
return false;
|
||||
}
|
||||
|
||||
var localState = $(this).attr('data-local-state');
|
||||
|
||||
if(localState == 'MISSING') {
|
||||
|
|
@ -109,6 +117,8 @@
|
|||
{
|
||||
var claimedRecording = $(this).data('server-model');
|
||||
|
||||
openingRecording = true;
|
||||
|
||||
// tell the server we are about to start a recording
|
||||
rest.startPlayClaimedRecording({id: context.JK.CurrentSessionModel.id(), claimed_recording_id: claimedRecording.id})
|
||||
.done(function(response) {
|
||||
|
|
@ -146,6 +156,9 @@
|
|||
app.notifyServerError(jqXHR, "Unable to Open Recording For Playback");
|
||||
|
||||
})
|
||||
.always(function() {
|
||||
openingRecording = false;
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue