From 1ae8196c5e0a2cd5f6785f22fe47b92f96dd38ef Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 11 Oct 2018 17:23:28 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9pare=20le=20bug=20firefox=20du=20localst?= =?UTF-8?q?orage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/Feedback/PageFeedback.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/components/Feedback/PageFeedback.js b/source/components/Feedback/PageFeedback.js index b81a3a24b..56927466d 100644 --- a/source/components/Feedback/PageFeedback.js +++ b/source/components/Feedback/PageFeedback.js @@ -5,6 +5,7 @@ import React, { Component } from 'react' import { Trans, translate } from 'react-i18next' import { withRouter } from 'react-router-dom' import { compose } from 'redux' +import safeLocalStorage from '../../storage/safeLocalStorage' import './Feedback.css' import Form from './FeedbackForm' import type { Tracker } from 'Components/utils/withTracker' @@ -30,10 +31,13 @@ const saveFeedbackOccurrenceInLocalStorage = ([name, path, rating]: [ string, number ]) => { - localStorage.setItem(localStorageKey([name, path]), JSON.stringify(rating)) + safeLocalStorage.setItem( + localStorageKey([name, path]), + JSON.stringify(rating) + ) } const feedbackAlreadyGiven = (feedback: [string, string]) => { - return !!localStorage.getItem(localStorageKey(feedback)) + return !!safeLocalStorage.getItem(localStorageKey(feedback)) } class PageFeedback extends Component {