diff --git a/src/components/LobbyScreen.vue b/src/components/LobbyScreen.vue index b3dd3579123..f374a1d3024 100644 --- a/src/components/LobbyScreen.vue +++ b/src/components/LobbyScreen.vue @@ -19,20 +19,28 @@ --> + + diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 5d1b847a1a5..54ed04d15a0 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -129,36 +129,7 @@ :name="conversation.displayName" /> -
-

- {{ t('spreed', 'Display name: ') }} {{ actorDisplayName ? actorDisplayName : t('spreed', 'Guest') }} - -

-
- - -
-
+ @@ -181,8 +152,8 @@ import { setConversationName, } from '../../services/conversationsService' import isInLobby from '../../mixins/isInLobby' -import { setGuestUserName } from '../../services/participantsService' import { generateUrl } from '@nextcloud/router' +import SetGuestUsername from '../SetGuestUsername' export default { name: 'RightSidebar', @@ -197,6 +168,7 @@ export default { ChatView, CollectionList, ParticipantsTab, + SetGuestUsername, }, mixins: [ @@ -218,8 +190,6 @@ export default { password: '', // Switch for the password-editing operation isEditingPassword: false, - guestUserName: '', - isEditingUsername: false, // Changes the conversation title into an input field for renaming isRenamingConversation: false, // The conversation name (while editing) @@ -255,10 +225,6 @@ export default { return this.$store.getters.getUserId() }, - actorDisplayName() { - return this.$store.getters.getDisplayName() - }, - isFavorited() { if (!this.getUserId) { return null @@ -428,35 +394,6 @@ export default { this.password = '' this.isEditingPassword = false }, - async handleChooseUserName() { - const previousName = this.$store.getters.getDisplayName() - try { - this.$store.dispatch('setDisplayName', this.guestUserName) - this.$store.dispatch('forceGuestName', { - token: this.token, - actorId: this.$store.getters.getActorId().substring(6), - actorDisplayName: this.guestUserName, - }) - await setGuestUserName(this.token, this.guestUserName) - this.isEditingUsername = false - } catch (exception) { - this.$store.dispatch('setDisplayName', previousName) - this.$store.dispatch('forceGuestName', { - token: this.token, - actorId: this.$store.getters.getActorId().substring(6), - actorDisplayName: previousName, - }) - console.debug(exception) - } - }, - - /** For when the currentUser is guest */ - handleEditUsername() { - this.isEditingUsername = !this.isEditingUsername - this.$nextTick(() => { - this.$refs.usernameInput.focus() - }) - }, handleRenameConversation() { // Copy the current conversation's title into the renaming title @@ -511,26 +448,4 @@ export default { padding: 0; } -/** Username form for guest users */ -.username-form { - padding: 0 12px; - & .icon-rename { - margin-left: 8px; - padding-left: 36px; - background-position: 12px; - } - &__wrapper { - display: flex; - } - &__input { - padding-right: var(--clickable-area); - width: 300px; - } - &__button { - margin-left: -44px; - background-color: transparent; - border: none; - } -} - diff --git a/src/components/SetGuestUsername.vue b/src/components/SetGuestUsername.vue new file mode 100644 index 00000000000..f85e8c4b390 --- /dev/null +++ b/src/components/SetGuestUsername.vue @@ -0,0 +1,138 @@ + + + + + + +