mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 02:27:49 +01:00
simplify returnPath logic via composer default
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user