UI: переход на history-router без # и короткие ссылки тредов

This commit is contained in:
AidarKC
2026-05-19 10:15:15 +03:00
parent 3a0899bcfe
commit db2d9a666b
9 changed files with 61 additions and 28 deletions
+3 -3
View File
@@ -110,7 +110,8 @@ function blockRefToMessageKey(blockRef, fallbackBch = '') {
function buildAbsoluteRouteUrl(routePath = '') {
const cleanRoute = String(routePath || '').replace(/^#?\/?/, '');
const url = new URL(window.location.href);
url.hash = `#/${cleanRoute}`;
url.pathname = `/${cleanRoute}`;
url.hash = '';
return url.toString();
}
@@ -150,7 +151,6 @@ function buildThreadRoute(messageRef, selector) {
'm',
encodeRoutePart(messageRef.blockchainName),
messageRef.blockNumber,
normalizeRouteHash(messageRef.blockHash),
].join('/');
}
@@ -890,7 +890,7 @@ export function render({ navigate, route }) {
const login = state.session.login;
const storagePwd = state.session.storagePwdInMemory;
if (!login || !storagePwd) {
state.authReturnHash = window.location.hash || '#/channels-list';
state.authReturnHash = window.location.pathname || '/channels-list';
navigate('login-view');
throw new Error('Для этого действия нужно войти');
}