diff --git a/src/services/wiki/index.ts b/src/services/wiki/index.ts index 607d337b..5e1b8f18 100644 --- a/src/services/wiki/index.ts +++ b/src/services/wiki/index.ts @@ -682,10 +682,10 @@ export class Wiki implements IWikiService { } public async restartWiki(workspace: IWorkspace): Promise { - const { id, userName: workspaceUserName, isSubWiki } = workspace; + const { id, isSubWiki } = workspace; // use workspace specific userName first, and fall back to preferences' userName, pass empty editor username if undefined // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - const userName = (workspaceUserName || (await this.authService.get('userName'))) ?? ''; + const userName = await this.authService.getUserName(workspace); this.stopIntervalSync(workspace); if (!isSubWiki) { diff --git a/src/services/workspacesView/index.ts b/src/services/workspacesView/index.ts index dd184b80..b425d727 100644 --- a/src/services/workspacesView/index.ts +++ b/src/services/workspacesView/index.ts @@ -352,7 +352,7 @@ export class WorkspaceView implements IWorkspaceViewService { const workspace = await this.workspaceService.get(workspaceID); if (workspace !== undefined) { // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - const userName = (workspace.userName || (await this.authService.get('userName'))) ?? ''; + const userName = await this.authService.getUserName(workspace); await Promise.all([ this.wikiService.startWiki(workspaceID, userName), this.viewService.addViewForAllBrowserViews(workspace),