Skip to content

Commit

Permalink
Fix UX of renaming token
Browse files Browse the repository at this point in the history
Now this get's instant applied and escaping will reset to the previous
state

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan authored and backportbot-nextcloud[bot] committed Nov 24, 2022
1 parent f1a43e3 commit 2378a53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/settings/src/components/AuthToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
v-model="newName"
type="text"
@keyup.enter="rename"
@blur="cancelRename"
@change="rename"
@keyup.esc="cancelRename">
<span v-else>{{ iconName.name }}</span>
<span v-if="wiping" class="wiping-warning">({{ t('settings', 'Marked for remote wipe') }})</span>
Expand Down Expand Up @@ -170,6 +170,7 @@ export default {
showMore: this.token.canScope || this.token.canDelete,
renaming: false,
newName: '',
oldName: '',
actionOpen: false,
}
},
Expand Down Expand Up @@ -229,6 +230,7 @@ export default {
// Close action (popover menu)
this.actionOpen = false

this.oldName = this.token.name
this.newName = this.token.name
this.renaming = true
this.$nextTick(() => {
Expand All @@ -237,6 +239,7 @@ export default {
},
cancelRename() {
this.renaming = false
this.$emit('rename', this.token, this.oldName)
},
revoke() {
this.actionOpen = false
Expand Down

0 comments on commit 2378a53

Please sign in to comment.