Skip to content

Commit

Permalink
FIX: Locally storing names of the diaries (#97)
Browse files Browse the repository at this point in the history
The local cache is cleaned when a diary access is removed.

Thanks to Lola Dente !
  • Loading branch information
christophe-lejeune committed Oct 5, 2024
1 parent 98ea4f7 commit 3894316
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors:
given-names: "Christophe"
orcid: "https://orcid.org/0000-0002-3622-7050"
title: "Cassandre. Diary for qualitative analysis"
version: 3.24.07.29
date-released: 2024-07-29
version: 3.24.10.05
date-released: 2024-10-05
url: "https://github.com/Hypertopic/Cassandre/"
preferred-citation:
type: article
Expand Down
2 changes: 1 addition & 1 deletion app/ddocs/cassandre/shows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(o, req) {
return {
body: JSON.stringify({
service: 'Cassandre',
revision: '3.24.07.29',
revision: '3.24.10.05',
update_seq: req.info.update_seq
})
}
Expand Down
6 changes: 6 additions & 0 deletions app/ddocs/cassandre/templates/diaries.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ <h5 class="card-title">{{i18n.i_create.diary}}</h5>
<script>
let added = [],
register = [],
restricted = [],
fullnames = [],
id = '',
logged = "{{logged}}",
Expand Down Expand Up @@ -154,11 +155,16 @@ <h5 class="card-title">{{i18n.i_create.diary}}</h5>
if (!$('#'+id).length) {
addToDom(id, d.name)
}
restricted.push(id)
}
}
}).done(function(){
if (added.length > 1) $("#show").removeClass('d-none');
if (added.length > 3) $(".in-collection").removeClass('d-none');
let past = added.filter(x => !restricted.includes(x))
for (var p of past) {
localStorage.removeItem(p)
}
if (!localStorage.getItem('my_diaries') || localStorage.getItem('my_diaries') !== JSON.stringify(added))
localStorage.setItem('my_diaries', JSON.stringify(added))
$(".collection").each(function() {
Expand Down

0 comments on commit 3894316

Please sign in to comment.