Merged in fix/intl-global-error (pull request #1510)
Fix: Error message when copy fail. Null check on localstorage. Removed Intl from global-error.tsx * Error message if failed to copy * Use try/catch instead Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -42,8 +42,12 @@ export default function Campaign() {
|
||||
<footer className={styles.modalFooter}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(reward.operaRewardId)
|
||||
toast.success(intl.formatMessage({ id: "Copied to clipboard" }))
|
||||
try {
|
||||
navigator.clipboard.writeText(reward.operaRewardId)
|
||||
toast.success(intl.formatMessage({ id: "Copied to clipboard" }))
|
||||
} catch {
|
||||
toast.error(intl.formatMessage({ id: "Failed to copy" }))
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
variant="icon"
|
||||
|
||||
Reference in New Issue
Block a user