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>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
navigator.clipboard.writeText(sourceUrl);
|
navigator.clipboard.writeText(sourceUrl).then(() => {
|
||||||
useUIStore.getState().addToast('Copied link', 'success', 3000);
|
useUIStore.getState().addToast('Copied link', 'success', 3000);
|
||||||
|
}).catch(() => {
|
||||||
|
useUIStore.getState().addToast('Failed to copy link', 'warning', 3000);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user