Skip to content

Commit

Permalink
refactor: rename function to setGuestNameCookie for clarity
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <[email protected]>
  • Loading branch information
elzody committed Apr 26, 2024
1 parent 5271247 commit a3ee201
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/GuestNamePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import { NcButton, NcIconSvgWrapper, NcModal, NcTextField } from '@nextcloud/vue'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import { setGuestName } from '../helpers/guestName.js'
import { setGuestNameCookie } from '../helpers/guestName.js'
export default {
name: 'GuestNamePicker',
Expand Down Expand Up @@ -99,7 +99,7 @@ export default {
this.guestName = guestName
},
async submit() {
setGuestName(this.guestName)
setGuestNameCookie(this.guestName)
this.show = false
await this.onSubmit(this.guestName)
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/guestName.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const cookieAlreadySet = (cookieName) => {
})
}

const setGuestName = function(username) {
const setGuestNameCookie = (username) => {
if (username !== '') {
document.cookie = 'guestUser=' + encodeURIComponent(username) + '; path=/'
}
Expand All @@ -46,6 +46,6 @@ const shouldAskForGuestName = async () => {
}

export {
setGuestName,
setGuestNameCookie,
shouldAskForGuestName,
}

0 comments on commit a3ee201

Please sign in to comment.