SHA256
Обновить публичные ссылки и аватары каналов
This commit is contained in:
@@ -106,6 +106,12 @@ export function parseRouteFromPath(pathname = '') {
|
||||
};
|
||||
const isLikelyBlockNumber = (value) => /^[0-9]+$/.test(String(value || '').trim());
|
||||
|
||||
// Прямая публичная ссылка на профиль, в отличие от адреса канала.
|
||||
if (segments.length === 3 && segments[0].toLowerCase() === 'shine' && segments[1].toLowerCase() === 'prof') {
|
||||
const profileLogin = decodePart(segments[2]);
|
||||
if (profileLogin) return { pageId: 'user', params: { login: profileLogin, fromPage: 'messages-list', section: 'profile' } };
|
||||
}
|
||||
|
||||
const shineRoute = parseShineRouteParts(segments);
|
||||
if (shineRoute?.entity) {
|
||||
const shineLogin = shineRoute.entity;
|
||||
@@ -531,6 +537,11 @@ export function toPrettyPath(path) {
|
||||
if (!segments.length) return '';
|
||||
const [head, ...tail] = segments;
|
||||
const prettyHead = PRETTY_PATHS.get(head) || head;
|
||||
// Старые вызовы навигации могут передавать %40 через encodeURIComponent.
|
||||
// Для публичных SHiNE-путей оставляем @ видимым, сохраняя остальные escape-коды.
|
||||
if (prettyHead.toLowerCase() === 'shine') {
|
||||
return [prettyHead, ...tail.map((segment) => segment.replace(/%40/gi, '@'))].join('/');
|
||||
}
|
||||
return [prettyHead, ...tail].join('/');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user