Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Commit

Permalink
Updates localStorage schema. Closes #67. (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscox committed Jan 18, 2017
1 parent 823d8e2 commit a6ca1b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/LocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export class LocalStorage {
* @return {ISerializableDataMap} The json data from local storage.
*/
private static getRawData(): ISerializableDataMap {
let data: ISerializableDataMap = JSON.parse(localStorage.getItem(StorageKey.REMIXER));
return data || {};
let data = JSON.parse(localStorage.getItem(StorageKey.REMIXER));
return data ? data.variables : {};
}

/**
Expand All @@ -123,6 +123,6 @@ export class LocalStorage {
* @param {ISerializableDataMap} data The serialized data to save.
*/
private static saveRawData(data: ISerializableDataMap): void {
localStorage.setItem(StorageKey.REMIXER, JSON.stringify(data));
localStorage.setItem(StorageKey.REMIXER, JSON.stringify({variables: data}));
}
}

0 comments on commit a6ca1b2

Please sign in to comment.