0

Please see follow-up question here here where it gets to the meat of the problem.

I am making an ajax call that reloads the data in the local storage of an Ember App. I am calling localStorage.clear(); right before the ajax call. However, after the ajax call, nothing is cleared!

The printout localStorage.getItem("model-emberjs") right after the clear() and is null as expected.
The printout localStorage.getItem("model-emberjs") right after the ajax call that follows has everything from before.

I'm using the LS adapter.

Do you have any idea why?


P.S. I don't know how to make ajax call work in jsbin so sorry no live example.

Community
  • 1
  • 1
HaoQi Li
  • 11,970
  • 14
  • 58
  • 77

1 Answers1

0

As @Benjamin already mentioned I also believe you have a caching problem. If you are using chrome try to disable the cache while developing by bringing up the extra settings dialog:

enter image description here

And then enable "Disable cache":

enter image description here

Now try again to call localStorage.clear() it should work this time.

Hope it helps.

Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215
intuitivepixel
  • 23,302
  • 3
  • 57
  • 51