Skip to content

Commit

Permalink
feat: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Aug 29, 2024
1 parent f93cdb1 commit 80f25b1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export const admin = (() => {
storage('likes').clear();
storage('config').clear();
storage('comment').clear();
storage('session').clear();
}

if (!session.isAdmin() || JSON.parse(atob(token.get('token').split('.')[1])).exp < ((new Date()).getTime() / 1000)) {
Expand All @@ -280,6 +281,7 @@ export const admin = (() => {

getUserDetail();
getStatUser();
comment.setEmpty();
comment.comment();
};

Expand Down
1 change: 0 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { pagination } from './pagination.js';
document.addEventListener('DOMContentLoaded', () => {
audio.init();
theme.check();
comment.init();
pagination.init();

guest.init();
Expand Down
4 changes: 2 additions & 2 deletions js/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export const comment = (() => {
}
};

const init = () => {
const setEmpty = () => {
if (!showHide.has('hidden')) {
showHide.set('hidden', []);
}
Expand All @@ -395,7 +395,7 @@ export const comment = (() => {
};

return {
init,
setEmpty,
cancel,
send,
edit,
Expand Down
5 changes: 2 additions & 3 deletions js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import { comment } from './comment.js';
import { pagination } from './pagination.js';

document.addEventListener('DOMContentLoaded', () => {
admin.init();

theme.check();
comment.init();
pagination.init();

admin.init();

window.like = like;
window.admin = admin;
Expand Down
3 changes: 2 additions & 1 deletion js/guest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { util } from './util.js';
import { audio } from './audio.js';
import { theme } from './theme.js';
import { session } from "./session.js";
import { session } from './session.js';
import { storage } from './storage.js';
import { confetti } from './confetti.js';

Expand Down Expand Up @@ -96,6 +96,7 @@ export const guest = (() => {
storage('user').clear();
storage('owns').clear();
storage('likes').clear();
storage('session').clear();
storage('comment').clear();
storage('tracker').clear();
}
Expand Down
4 changes: 2 additions & 2 deletions js/request.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dto } from "./dto.js";
import { session } from "./session.js";
import { dto } from './dto.js';
import { session } from './session.js';

export const HTTP_GET = 'GET';
export const HTTP_POST = 'POST';
Expand Down
1 change: 1 addition & 0 deletions js/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const session = (() => {
config.set(key, value);
}

comment.setEmpty();
await comment.comment();
progress.complete('request');
}).catch(() => {
Expand Down

0 comments on commit 80f25b1

Please sign in to comment.