Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/ipfs-webui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9327e46c275e
Choose a base ref
...
head repository: ipfs/ipfs-webui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d8024c6ce864
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 3, 2016

  1. Added a log

    As noted by @diasdavid in #130 (comment)
    RichardLitt committed Jan 3, 2016
    Copy the full SHA
    d448dd3 View commit details
  2. Copy the full SHA
    d8024c6 View commit details
Showing with 8 additions and 2 deletions.
  1. +8 −2 app/scripts/utils/localStorage.js
10 changes: 8 additions & 2 deletions app/scripts/utils/localStorage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import _ from 'lodash'
import debug from 'debug'

const log = debug('utils:localStorage')
const warn = debug('utils:localStorage:warn')

// Utility to make interacting with localstorage less painful.
var ls = process.browser && window.localStorage
@@ -30,11 +34,13 @@ function doOperation (op) {
if (op === 'getItem') {
try {
result = JSON.parse(result)
} catch (e) {}
} catch (e) {
log('Unable to parse result as json. Message: %s', e.message)
}
}

return result
} catch (e) {
console.warn('LocalStorage error: ' + e.message)
warn(e.message)
}
}