simplify returnPath logic via composer default

This commit is contained in:
Barış Soner Uşaklı
2026-02-08 23:41:21 -05:00
parent e4d852b4ca
commit dda0480abf
2 changed files with 2 additions and 9 deletions

View File

@@ -97,7 +97,7 @@
"multer": "2.0.2",
"nconf": "0.13.0",
"nodebb-plugin-2factor": "7.6.1",
"nodebb-plugin-composer-default": "10.3.11",
"nodebb-plugin-composer-default": "10.3.12",
"nodebb-plugin-dbsearch": "6.3.5",
"nodebb-plugin-emoji": "6.0.5",
"nodebb-plugin-emoji-android": "4.1.1",

View File

@@ -573,16 +573,9 @@ $(document).ready(function () {
if (ev !== null && ev.state) {
const { returnPath } = ev.state;
if (ev.state.url === null && returnPath !== undefined) {
const url = returnPath;
const prependSlash = url && !url.startsWith('?') && !url.startsWith('#');
const { relative_path } = config;
const historyUrl = prependSlash ?
(relative_path + '/' + url) :
relative_path + (url || (relative_path ? '' : '/'));
window.history.replaceState({
url: returnPath,
}, '', historyUrl);
}, '', returnPath);
} else if (ev.state.url !== undefined) {
ajaxify.handleTransientElements();
ajaxify.go(ev.state.url, function () {