mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-21 03:51:15 -08:00
refactor: move authInfo check to initializeWorkspaceView
This commit is contained in:
parent
42ae2a61de
commit
3a0e96f9eb
2 changed files with 13 additions and 13 deletions
|
|
@ -197,19 +197,6 @@ export class View implements IViewService {
|
|||
const { rememberLastPageVisited, shareWorkspaceBrowsingData, spellcheck, spellcheckLanguages } = await this.preferenceService.getPreferences();
|
||||
// configure session, proxy & ad blocker
|
||||
const partitionId = shareWorkspaceBrowsingData ? 'persist:shared' : `persist:${workspace.id}`;
|
||||
if (workspace.storageService !== SupportedStorageServices.local) {
|
||||
const userInfo = this.authService.getStorageServiceUserInfo(workspace.storageService);
|
||||
if (userInfo === undefined) {
|
||||
// user not login into Github or something else
|
||||
void dialog.showMessageBox(browserWindow, {
|
||||
title: i18n.t('Dialog.StorageServiceUserInfoNoFound'),
|
||||
message: i18n.t('Dialog.StorageServiceUserInfoNoFoundDetail'),
|
||||
buttons: ['OK'],
|
||||
cancelId: 0,
|
||||
defaultId: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
// prepare configs for start a BrowserView that loads wiki's web content
|
||||
// session
|
||||
const sessionOfView = session.fromPartition(partitionId);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,19 @@ export class WorkspaceView implements IWorkspaceViewService {
|
|||
if (mainWindow === undefined) {
|
||||
throw new Error(i18n.t(`Error.MainWindowMissing`));
|
||||
}
|
||||
if (workspace.storageService !== SupportedStorageServices.local) {
|
||||
const userInfo = this.authService.getStorageServiceUserInfo(workspace.storageService);
|
||||
if (userInfo === undefined) {
|
||||
// user not login into Github or something else
|
||||
void dialog.showMessageBox(mainWindow, {
|
||||
title: i18n.t('Dialog.StorageServiceUserInfoNoFound'),
|
||||
message: i18n.t('Dialog.StorageServiceUserInfoNoFoundDetail'),
|
||||
buttons: ['OK'],
|
||||
cancelId: 0,
|
||||
defaultId: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
await this.wikiService.wikiStartup(workspace);
|
||||
|
||||
const userInfo = await this.authService.getStorageServiceUserInfo(workspace.storageService);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue