File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ var getInitStatus = (function() {
9494
9595var PvCache = ( function ( ) {
9696 const KEY_PV = "pv" ;
97- const KEY_CREATION = "pv-created-date " ;
98- const KEY_PV_TYPE = "pv-type " ;
97+ const KEY_CREATION = "pv_created_date " ;
98+ const KEY_PV_TYPE = "pv_type " ;
9999
100100 var PvType = {
101101 ORIGIN : "origin" ,
@@ -148,6 +148,13 @@ var PvCache = (function() {
148148 } ,
149149 newerThan : function ( pv ) {
150150 return PvCache . getAllPagevies ( ) > pv . totalsForAllResults [ "ga:pageviews" ] ;
151+ } ,
152+ inspectKeys : function ( ) {
153+ if ( localStorage . getItem ( KEY_PV ) == null
154+ || localStorage . getItem ( KEY_PV_TYPE ) == null
155+ || localStorage . getItem ( KEY_CREATION ) == null ) {
156+ localStorage . clear ( ) ;
157+ }
151158 }
152159 } ;
153160
@@ -184,6 +191,8 @@ $(function() {
184191
185192 if ( $ ( '.pageviews' ) . length > 0 ) {
186193
194+ PvCache . inspectKeys ( ) ;
195+
187196 let cache = PvCache . getData ( ) ;
188197
189198 if ( cache ) {
You can’t perform that action at this time.
0 commit comments