1- /**
1+ /*!
22 * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
33 * SPDX-License-Identifier: GPL-3.0-or-later
44 */
5+
6+ import type { NextcloudUser } from './user.ts'
7+
58import { getBuilder } from '@nextcloud/browser-storage'
6- import { NextcloudUser } from './user'
79import { emit , subscribe } from '@nextcloud/event-bus'
810
911const browserStorage = getBuilder ( 'public' ) . persist ( ) . build ( )
1012
1113class GuestUser implements NextcloudUser {
12-
1314 private _displayName : string | null
1415 readonly uid : string
1516 readonly isAdmin : boolean
@@ -27,7 +28,6 @@ class GuestUser implements NextcloudUser {
2728 this . _displayName = guest . displayName
2829 browserStorage . setItem ( 'guestNickname' , guest . displayName || '' )
2930 } )
30-
3131 }
3232
3333 get displayName ( ) : string | null {
@@ -39,7 +39,6 @@ class GuestUser implements NextcloudUser {
3939 browserStorage . setItem ( 'guestNickname' , displayName )
4040 emit ( 'user:info:changed' , this )
4141 }
42-
4342}
4443
4544let currentUser : NextcloudUser | undefined
@@ -64,7 +63,8 @@ export function getGuestNickname(): string | null {
6463
6564/**
6665 * Set the guest nickname for public pages
67- * @param nickname The nickname to set
66+ *
67+ * @param nickname - The nickname to set
6868 */
6969export function setGuestNickname ( nickname : string ) : void {
7070 if ( ! nickname || nickname . trim ( ) . length === 0 ) {
0 commit comments