diff --git a/src/client/d3/d3.js b/src/client/d3/d3.js index b8f9c5f..dc02c56 100644 --- a/src/client/d3/d3.js +++ b/src/client/d3/d3.js @@ -234,7 +234,7 @@ function render(updatedData) { const heading = splitData[0].split('=')[1]; const text = splitData[1].split('=')[1]; const tag = splitData[2].split('=')[1]; - // storePendingActions('textToAdd', { memories: [{ id, text }] }, { id, text }); + storePendingActions('textToAdd', { memories: [{ id: 100, heading, text, tag }] }, { id: 100, heading, text, tag }); // const offlineData = removeMemoryFromStoredData(id); // render(formatData(offlineData)); } diff --git a/src/client/helpers/helpers.js b/src/client/helpers/helpers.js index e3327f6..888f549 100644 --- a/src/client/helpers/helpers.js +++ b/src/client/helpers/helpers.js @@ -261,6 +261,15 @@ function removeMemoryFromStoredData(id) { return offlineData; } +function addMemoryToStoredData(id) { +// const offlineData = JSON.parse(localStorage.getItem('data')); +// const toAdd = +// offlineData.push() +// const offlineDataAfterAdding = JSON.stringify(offlineData); +// localStorage.setItem('data', offlineDataAfterRemoving); +// return offlineData; +} + function clearPendingActions(storedName, index) { const memoriesWaitingToBeRemoved = JSON.parse(localStorage.getItem(storedName)); if (memoriesWaitingToBeRemoved.memories.length === 1) {