mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 06:16:59 +08:00
feat(core): desktop multiple server support (#8979)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export interface AuthenticationRequest {
|
||||
method: 'magic-link' | 'oauth';
|
||||
payload: Record<string, any>;
|
||||
server?: string;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
BrowserWindow,
|
||||
Menu,
|
||||
MenuItem,
|
||||
session,
|
||||
type View,
|
||||
type WebContents,
|
||||
WebContentsView,
|
||||
@@ -26,7 +25,7 @@ import {
|
||||
|
||||
import { isMacOS } from '../../shared/utils';
|
||||
import { beforeAppQuit } from '../cleanup';
|
||||
import { CLOUD_BASE_URL, isDev } from '../config';
|
||||
import { isDev } from '../config';
|
||||
import { mainWindowOrigin, shellViewUrl } from '../constants';
|
||||
import { ensureHelperProcess } from '../helper-process';
|
||||
import { logger } from '../logger';
|
||||
@@ -722,23 +721,6 @@ export class WebContentViewsManager {
|
||||
// add shell view
|
||||
this.createAndAddView('shell').catch(err => logger.error(err));
|
||||
(async () => {
|
||||
const updateCookies = () => {
|
||||
session.defaultSession.cookies
|
||||
.get({
|
||||
url: CLOUD_BASE_URL,
|
||||
})
|
||||
.then(cookies => {
|
||||
this.cookies = cookies;
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error('failed to get cookies', err);
|
||||
});
|
||||
};
|
||||
updateCookies();
|
||||
session.defaultSession.cookies.on('changed', () => {
|
||||
updateCookies();
|
||||
});
|
||||
|
||||
if (this.tabViewsMeta.workbenches.length === 0) {
|
||||
// create a default view (e.g., on first launch)
|
||||
await this.addTab();
|
||||
@@ -921,10 +903,6 @@ export class WebContentViewsManager {
|
||||
};
|
||||
}
|
||||
|
||||
export function getCookies() {
|
||||
return WebContentViewsManager.instance.cookies;
|
||||
}
|
||||
|
||||
// there is no proper way to listen to webContents resize event
|
||||
// we will rely on window.resize event in renderer instead
|
||||
export async function handleWebContentsResize(webContents?: WebContents) {
|
||||
|
||||
Reference in New Issue
Block a user