Skip to content

Commit

Permalink
solved issue with data duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Ivanchenko authored and Sergii Ivanchenko committed Jan 24, 2017
1 parent 56abc0e commit cf65f4d
Showing 1 changed file with 45 additions and 17 deletions.
62 changes: 45 additions & 17 deletions frontEnd/src/providers/local-data-save-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class LocalDataSaveService {
saveCSVFile(): any {

var currentTime = this.global.transformTimeStamp(0, 2);
var fileContent: string;
// var fileContent: string;

// this.appCSVFile = "data_ID_" + this.global.sessionID + "_" + currentTime + ".csv";

Expand All @@ -122,28 +122,56 @@ export class LocalDataSaveService {
(fileContent) => {

// this.clOnScreen5 = "prepareCSVconent: " + fileContent;

return this.platform.ready().then(
return this.global.globalCleanDataFile().then(
() => {
return File.writeFile(
this.global.appFilesDirectory,
this.global.appCSVFile,
fileContent,
{replace: true}
)
.then(
(result) => {

return this.serverService.sendDataToServer(fileContent, "data");
}
);
return this.platform.ready().then(
() => {
return File.writeFile(
this.global.appFilesDirectory,
this.global.appCSVFile,
fileContent,
{replace: true}
)
.then(
(result) => {

return this.serverService.sendDataToServer(fileContent, "data");

}
);

}
// );

}
// );

);

}
);


// return this.platform.ready().then(
// () => {
// return File.writeFile(
// this.global.appFilesDirectory,
// this.global.appCSVFile,
// fileContent,
// {replace: true}
// )
// .then(
// (result) => {
//
// // return this.serverService.sendDataToServer(fileContent, "data");
//
// }
// );
//
//
// }
// // );
//
// );

}
);
// fileContent= this.prepareCSVContent();
Expand Down

0 comments on commit cf65f4d

Please sign in to comment.