mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-23 04:52:02 -08:00
refactor: const userName = await this.authService.getUserName(workspace);
This commit is contained in:
parent
9514e8dc66
commit
1ff128aaa8
2 changed files with 3 additions and 3 deletions
|
|
@ -682,10 +682,10 @@ export class Wiki implements IWikiService {
|
|||
}
|
||||
|
||||
public async restartWiki(workspace: IWorkspace): Promise<void> {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue