Add too fast load protection (yes it exists)

This commit is contained in:
2018-12-13 09:00:31 -05:00
parent 0c5e514d33
commit 97e64e19c9
2 changed files with 20 additions and 6 deletions
@@ -16,9 +16,15 @@ export default Ember.Component.extend
contentType: "application/json"
dataType: "json"
success: (response) ->
debugger
console.log response
popup.setSemanticAttr('html', response)
#debugger
#console.log response
finish_time = new Date()
action_info_load_time = finish_time - start_time
console.log "Action info for action #{identifier} loaded (#{Math.round(action_info_load_time / 100) / 10}s)"
if action_info_load_time < 500 # too fast response will not be shown due to fade in effect (I think)
setTimeout((-> popup.setSemanticAttr('html', response)), 500)
else
popup.setSemanticAttr('html', response)
if Ember.get(session, 'isAuthenticated')
session.authorize 'authorizer:devise', (key, authorization) ->
request.crossDomain = true
@@ -20,9 +20,17 @@ export default Ember.Component.extend({
contentType: "application/json",
dataType: "json",
success: function(response) {
debugger;
console.log(response);
return popup.setSemanticAttr('html', response);
var action_info_load_time, finish_time;
finish_time = new Date();
action_info_load_time = finish_time - start_time;
console.log("Action info for action " + identifier + " loaded (" + (Math.round(action_info_load_time / 100) / 10) + "s)");
if (action_info_load_time < 500) {
return setTimeout((function() {
return popup.setSemanticAttr('html', response);
}), 500);
} else {
return popup.setSemanticAttr('html', response);
}
}
};
if (Ember.get(session, 'isAuthenticated')) {