Skip to content

Commit

Permalink
fix: persistent presence
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 5, 2024
1 parent 6239f0e commit f47d8b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export const admin = (() => {
}

if (!session.isAdmin() || (JSON.parse(atob((session.getToken() ?? '.').split('.')[1])).exp ?? 0) < ((new Date()).getTime() / 1000)) {
comment.renderLoading();
(new bootstrap.Modal('#loginModal')).show();
return;
}
Expand Down
7 changes: 6 additions & 1 deletion js/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export const comment = (() => {
document.getElementById(`inner-${id}`).remove();
document.getElementById(`content-${id}`).innerHTML = card.convertMarkdownToHTML(util.escapeHtml(form.value));

const formPresence = document.getElementById('form-presence');
if (presence) {
formPresence.value = isPresent ? "1" : "2";
storage('information').set('presence', isPresent);
}

if (!presence || !badge) {
return;
}
Expand Down Expand Up @@ -428,6 +434,5 @@ export const comment = (() => {
update,
comment,
showOrHide,
renderLoading: card.renderLoading,
}
})();
1 change: 0 additions & 1 deletion js/guest.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const guest = (() => {
};

const init = () => {

if (session.isAdmin()) {
storage('user').clear();
storage('owns').clear();
Expand Down

0 comments on commit f47d8b6

Please sign in to comment.