Skip to content

Commit

Permalink
fix(webui): only show API key copy button if clipboard is available
Browse files Browse the repository at this point in the history
Closes: #1675
  • Loading branch information
gotson committed Sep 4, 2024
1 parent 4cd838a commit 4351086
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions komga-webui/src/components/dialogs/ApiKeyAddDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<v-icon color="success">mdi-check</v-icon>
{{ apiKey.key }}

<v-tooltip top v-model="copied">
<v-tooltip top v-model="copied" v-if="isClipboardApiAvailable">
<template v-slot:activator="on">
<v-btn v-on="on"
icon
Expand All @@ -59,7 +59,7 @@
<v-card-actions>
<v-spacer/>
<v-btn text @click="dialogClose">{{ $t('common.close') }}</v-btn>
<v-btn color="primary" @click="generateApiKey" :disabled="apiKey">{{ $t('dialog.add_api_key.button_confirm') }}</v-btn>
<v-btn color="primary" @click="generateApiKey" :disabled="!!apiKey">{{ $t('dialog.add_api_key.button_confirm') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down Expand Up @@ -109,6 +109,11 @@ export default Vue.extend({
comment: {required, validComment},
},
},
computed: {
isClipboardApiAvailable(): boolean {
return !!navigator.clipboard
},
},
methods: {
clear() {
this.apiKey = undefined
Expand Down

0 comments on commit 4351086

Please sign in to comment.