Skip to content

Commit

Permalink
add back button support for dms
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 15, 2023
1 parent 16a596f commit dd26027
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions layouts/header/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,8 @@ let userDataFunction = async user => {
}
document.getElementById('messages').addEventListener('click', async e => {
e.preventDefault();
location.hash = '#dm';

let inbox = inboxData;

modal = createModal(/*html*/`
Expand Down Expand Up @@ -3145,13 +3147,17 @@ setInterval(() => {
}
window.addEventListener('popstate', () => {
if(document.querySelector('iframe.iframe-navigation')) return;
let tv = document.querySelector('.tweet-viewer');
if(tv) return;
let nm = document.querySelector('.notifications-modal');
if(nm) {
let tv = document.querySelector('.tweet-viewer');
if(!tv) {
nm.parentElement.removeModal();
}
}
nm.parentElement.removeModal();
return;
}
let im = document.querySelector('.inbox-modal');
if(im) {
im.parentElement.removeModal();
}
});

switchDarkMode(vars.darkMode || (vars.timeMode && isDark()));
Expand Down

0 comments on commit dd26027

Please sign in to comment.