Skip to content

Commit

Permalink
#154 clipboard content does not disappear and show in the center of…
Browse files Browse the repository at this point in the history
… the screen
  • Loading branch information
DavidZhang73 committed Mar 15, 2022
1 parent 2f23245 commit 71d7c18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/hooks/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export const useAnnotation = () => {
}
if (clipboard) {
copyToClipboard(clipboard).then(() => {
utils.notify('Copied to clipboard: ' + clipboard, 'positive')
console.log('Copied to clipboard: ' + clipboard)
utils.notify('Copied to clipboard: ' + clipboard, 'positive', 0, 'center')
}).catch((err) => {
console.error('Failed to copy to clipboard', err)
utils.notify('Failed to copy to clipboard, please do it manually: ' + clipboard, 'negative', 10000)
Expand Down
8 changes: 5 additions & 3 deletions src/libs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ export default {
* @param message
* @param color
* @param timeout
* @param position
* @returns
*/
notify (message, color = 'positive', timeout = 5000) {
notify (message, color = 'positive', timeout = 5000, position = 'bottom-right') {
return Notify.create({
message: message,
color: color,
position: 'bottom-right',
timeout: timeout
position: position,
timeout: timeout,
closeBtn: timeout === 0 ? 'Dismiss' : false
})
},
/**
Expand Down

0 comments on commit 71d7c18

Please sign in to comment.