Skip to content

Commit

Permalink
fix: null comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 4, 2024
1 parent f025f0d commit 43669c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ export const admin = (() => {
};

const init = () => {
session.init();
theme.spyTop();

user = storage('user');

if (!session.isAdmin()) {
storage('owns').clear();
storage('likes').clear();
Expand All @@ -251,12 +246,17 @@ export const admin = (() => {
storage('information').clear();
}

session.init();
theme.spyTop();
comment.init();

user = storage('user');

if (!session.isAdmin() || !session.getToken() || (JSON.parse(atob((session.getToken() ?? '.').split('.')[1])).exp ?? 0) < (Date.now() / 1000)) {
bootstrap.Modal.getOrCreateInstance('#loginModal').show();
return;
}

comment.init();
getUserDetail();
getStatUser();
comment.comment();
Expand Down

0 comments on commit 43669c3

Please sign in to comment.