mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-08-05 06:50:10 +00:00
Optimize the public sending page and navigation logic in presentation mode to ensure consistency in user experience
This commit is contained in:
@@ -224,8 +224,17 @@ export default function SendsPage(props: SendsPageProps) {
|
||||
}
|
||||
}
|
||||
|
||||
function getAccessUrl(send: Send): string {
|
||||
const rawUrl = send.shareUrl || `/send/${send.accessId}`;
|
||||
if (/^https?:\/\//i.test(rawUrl)) return rawUrl;
|
||||
if (rawUrl.startsWith('/#/')) return `${window.location.origin}${rawUrl}`;
|
||||
if (rawUrl.startsWith('#/')) return `${window.location.origin}/${rawUrl}`;
|
||||
if (rawUrl.startsWith('/')) return `${window.location.origin}/#${rawUrl}`;
|
||||
return `${window.location.origin}/#/${rawUrl.replace(/^\/+/, '')}`;
|
||||
}
|
||||
|
||||
function copyAccessUrl(send: Send): void {
|
||||
const url = send.shareUrl || `${window.location.origin}/#/send/${send.accessId}`;
|
||||
const url = getAccessUrl(send);
|
||||
void copyTextToClipboard(url, { successMessage: t('txt_link_copied') });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user