Skip to content

Commit

Permalink
make back button from dms go to inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 16, 2023
1 parent 8d5110a commit 123cf00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions layouts/header/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2446,14 +2446,6 @@ let userDataFunction = async user => {
activeTweet = newActiveTweet;
}
}, { passive: true });
window.addEventListener("popstate", e => {
if(document.querySelector('.message-leave')) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
document.querySelector(".message-header-back").click();
}
});

// menu
let userMenu = document.getElementById('navbar-user-menu');
Expand Down Expand Up @@ -3145,7 +3137,7 @@ setInterval(() => {
if(style) style.remove();
}
}
window.addEventListener('popstate', () => {
window.addEventListener('popstate', e => {
if(document.querySelector('iframe.iframe-navigation')) return;
let tv = document.querySelector('.tweet-viewer');
if(tv) return;
Expand All @@ -3154,9 +3146,18 @@ setInterval(() => {
nm.parentElement.removeModal();
return;
}
let messageBox = document.querySelector('.message-box');
if(messageBox && !messageBox.hidden) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
document.querySelector(".message-header-back").click();
return;
}
let im = document.querySelector('.inbox-modal');
if(im) {
im.parentElement.removeModal();
return;
}
});

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Old Twitter Layout (2023)",
"description": "__MSG_ext_description__",
"version": "1.8.0.3",
"version": "1.8.0.4",
"manifest_version": 3,
"homepage_url": "https://github.com/dimdenGD/OldTwitter",
"background": {
Expand Down

0 comments on commit 123cf00

Please sign in to comment.