Skip to content

Commit

Permalink
Add folder name to each item in JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
iliashad committed Sep 22, 2019
1 parent b98b4de commit 1efc81c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/offline.js
@@ -1,6 +1,6 @@
const fs = require("fs");
import { getJSONFile, getDateFormat } from "./dashboard";

import {sendData} from "./client"
export function serverIsDown(fileDuration) {
createJsonFile(fileDuration);
}
Expand Down Expand Up @@ -55,7 +55,7 @@ function checkAndAddFile(fileDuration) {
var result = newArr.reduce(function(prev, item) {
var newItem = prev.find(function(i) {

return i.fileName === item.fileName;
return i.fileName === item.fileName && i.folderName === item.folderName ;
});
if (newItem) {

Expand All @@ -73,4 +73,6 @@ function checkAndAddFile(fileDuration) {
// add file duration array when we don't have in json file
durationsArr = fileDuration;
}

sendData()
}

0 comments on commit 1efc81c

Please sign in to comment.