Skip to content

Commit

Permalink
Fix copyToClipboard function (#3762)
Browse files Browse the repository at this point in the history
* Revert "Bump prettier from 2.8.8 to 3.0.0 (#3758)"

This reverts commit f77ae6d.

* ! Fix function optioinal option argument declaration
  • Loading branch information
PikachuEXE authored Jul 12, 2023
1 parent 8ab13b5 commit 0d10fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ export function showToast(message, time = null, action = null) {
* a toast with the error is shown. If the copy is successful and
* there is a success message, a toast with that message is shown.
* @param {string} content the content to be copied to the clipboard
* @param {string} messageOnSuccess the message to be displayed as a toast when the copy succeeds (optional)
* @param {string} messageOnError the message to be displayed as a toast when the copy fails (optional)
* @param {null|string} messageOnSuccess the message to be displayed as a toast when the copy succeeds (optional)
* @param {null|string} messageOnError the message to be displayed as a toast when the copy fails (optional)
*/
export async function copyToClipboard(content, { messageOnSuccess = null, messageOnError = null }) {
export async function copyToClipboard(content, { messageOnSuccess = null, messageOnError = null } = {}) {
if (navigator.clipboard !== undefined && window.isSecureContext) {
try {
await navigator.clipboard.writeText(content)
Expand Down

0 comments on commit 0d10fac

Please sign in to comment.