mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-19 15:51:11 +00:00
Unit testing Connections.ts (#66)
* Jest, Enzyme test env setup * unit tests for telemetry state update logic * remove sinon, superfluous scripts * Remove console log
This commit is contained in:
@@ -12,7 +12,11 @@ export class Persistent<Data> {
|
||||
const stored = window.localStorage.getItem(key) as Maybe<Stringified<Data>>;
|
||||
|
||||
if (stored) {
|
||||
this.value = parse(stored);
|
||||
try {
|
||||
this.value = parse(stored);
|
||||
} catch (err) {
|
||||
this.value = initial;
|
||||
}
|
||||
} else {
|
||||
this.value = initial;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user