fix: add clipboard error handling for Copy Link context menu item
This commit is contained in:
@@ -101,8 +101,11 @@ export function buildMessageMenuItems(params: MessageMenuParams): ContextMenuIte
|
||||
</svg>
|
||||
),
|
||||
onClick: () => {
|
||||
navigator.clipboard.writeText(sourceUrl);
|
||||
useUIStore.getState().addToast('Copied link', 'success', 3000);
|
||||
navigator.clipboard.writeText(sourceUrl).then(() => {
|
||||
useUIStore.getState().addToast('Copied link', 'success', 3000);
|
||||
}).catch(() => {
|
||||
useUIStore.getState().addToast('Failed to copy link', 'warning', 3000);
|
||||
});
|
||||
},
|
||||
});
|
||||
items.push({
|
||||
|
||||
Reference in New Issue
Block a user