Skip to content

Commit

Permalink
Merge pull request #14 from HumanDynamics/bug/meeting-reupload
Browse files Browse the repository at this point in the history
Bug/meeting reupload
  • Loading branch information
OrenLederman authored Oct 25, 2017
2 parents df64c0a + 9024bba commit a4df117
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ meetingPage = new Page("meeting",
app.meeting.writeLog("meeting ended",
{'end_method':"manual", "end_time":new Date()/1000}
).then(function () {
app.syncLogFile(app.meeting.getLogName(), true, "maunal", new Date())
app.syncLogFile(app.meeting.getLogName(), true, "manual", new Date())
})
if (app.meeting.pause_countdown) {
app.meeting.pause_countdown.end()
Expand Down Expand Up @@ -1248,13 +1248,21 @@ app = {
syncLogFile: function(filename, isComplete, endingMethod, endTime, meetings) {
console.log("Starting to sync")
var meeting_uuid = filename.split(".")[0]
var mtg_key = "";
$.each(meetings, function(key, val) {
if (val.uuid === meeting_uuid) {
mtg_key = key;
//break the loop we found it
return false;
}
});

if (meetings && (meeting_uuid in meetings) && meetings[meeting_uuid].is_complete) return
if (mtg_key && meetings[mtg_key].is_complete) return

if ( app.force_put || isComplete || (meetings && !(meeting_uuid in meetings))) {
if (app.force_put || isComplete || !mtg_key) {
app.force_put = false

console.log("PUTiing")
console.log("PUTting")
var fileTransfer = new FileTransfer();
var uri = encodeURI(BASE_URL + app.project.key + "/meetings");

Expand Down Expand Up @@ -1317,8 +1325,8 @@ app = {

} else {
console.log("Trying to POST")
var last_log_timestamp = meetings[meeting_uuid].last_log_timestamp
var last_log_serial = meetings[meeting_uuid].last_log_serial
var last_log_timestamp = meetings[mtg_key].last_log_timestamp
var last_log_serial = meetings[mtg_key].last_log_serial

var toPost = []
window.fileStorage.load(meeting_uuid + ".txt").then( function(log) {
Expand Down

0 comments on commit a4df117

Please sign in to comment.