Commit 2325c62b3c2b77f09a0e2da035f1032f50773d89

Authored by Fabio Teixeira
Committed by Gabriela Navarro
1 parent a20815d6

Fix block cache system bug

Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
public/mpog-download-block.js
... ... @@ -15,9 +15,11 @@
15 15  
16 16  
17 17 function get_download_list_template() {
18   - if(sessionStorage.getItem('download_list_block_template')) {
19   - window.download_list_template = sessionStorage.getItem('download_list_block_template');
20   - } {
  18 + var blockTemplate = JSON.parse(sessionStorage.getItem('download_list_block_template'));
  19 +
  20 + if(blockTemplate) {
  21 + window.download_list_template = blockTemplate;
  22 + } else {
21 23 $.get('/plugin/software_communities/get_block_template', function(response) {
22 24 window.download_list_template = response;
23 25 sessionStorage.setItem('download_list_block_template', response);
... ...