SHA256
Shorten public UI routes
This commit is contained in:
@@ -878,7 +878,7 @@ export function render({ navigate, route }) {
|
||||
const login = state.session.login;
|
||||
const storagePwd = state.session.storagePwdInMemory;
|
||||
if (!login || !storagePwd) {
|
||||
state.authReturnHash = window.location.pathname || '/channels-list';
|
||||
state.authReturnHash = window.location.pathname || '/channels';
|
||||
navigate('login-view');
|
||||
throw new Error('Для этого действия нужно войти');
|
||||
}
|
||||
|
||||
@@ -1200,7 +1200,7 @@ export function render({ navigate, route }) {
|
||||
const login = state.session.login;
|
||||
const storagePwd = state.session.storagePwdInMemory;
|
||||
if (!login || !storagePwd) {
|
||||
state.authReturnHash = window.location.pathname || '/channels-list';
|
||||
state.authReturnHash = window.location.pathname || '/channels';
|
||||
navigate('login-view');
|
||||
throw new Error('Для этого действия нужно войти');
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ export function render({ navigate, route }) {
|
||||
|
||||
const rerenderList = () => {
|
||||
try {
|
||||
const expectedPath = '/channels-list';
|
||||
const expectedPath = '/channels';
|
||||
if (window.location.pathname !== expectedPath) {
|
||||
window.history.replaceState({}, '', expectedPath);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ function openDeveloperAvatarUploadModal({ walletLogin, storagePwd, gateway } = {
|
||||
|
||||
async function forceUiUpdateNow() {
|
||||
try {
|
||||
window.history.replaceState({}, '', '/settings-view');
|
||||
window.history.replaceState({}, '', '/settings');
|
||||
window.dispatchEvent(new PopStateEvent('popstate'));
|
||||
} catch {}
|
||||
if (!('serviceWorker' in navigator)) {
|
||||
|
||||
@@ -142,7 +142,7 @@ export function render({ navigate }) {
|
||||
if (previewEl) previewEl.textContent = resolveLastMessagePreview(item.lastMessage) || 'Диалог пока пуст.';
|
||||
if (timeEl) timeEl.textContent = String(item.time || '');
|
||||
row.prepend(avatarWrap);
|
||||
row.addEventListener('click', () => navigate(`chat-view/${encodeURIComponent(normalizeDmChatId(item.id))}`));
|
||||
row.addEventListener('click', () => navigate(`chat/${encodeURIComponent(normalizeDmChatId(item.id))}`));
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ export function render({ navigate, route }) {
|
||||
const act = btn.dataset.act;
|
||||
if (act === 'close') hideNodeSheet();
|
||||
else if (act === 'profile') { const r = profileInfoRoute(login); if (r) navigate(r); }
|
||||
else if (act === 'write') navigate(`chat-view/${encodeURIComponent(login)}`);
|
||||
else if (act === 'write') navigate(`chat/${encodeURIComponent(login)}`);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ export function render({ navigate, route }) {
|
||||
point,
|
||||
actions: [
|
||||
{ label: 'Профиль', onClick: () => { const r = profileInfoRoute(login); if (r) navigate(r); } },
|
||||
{ label: 'Написать', onClick: () => navigate(`chat-view/${encodeURIComponent(login)}`) },
|
||||
{ label: 'Написать', onClick: () => navigate(`chat/${encodeURIComponent(login)}`) },
|
||||
],
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user