fix(electron): do not restore window on get window (#5163)

fix https://github.com/toeverything/AFFiNE/issues/5161

Looks like I used window.restore incorrectly.
This commit is contained in:
Peng Xiao
2023-12-02 15:13:48 +00:00
parent 1f7654e80f
commit 512504e177
4 changed files with 30 additions and 18 deletions
@@ -119,8 +119,12 @@ export function registerProtocol() {
// if sending request to the cloud, attach the session cookie
if (isNetworkResource(pathname)) {
const cookie = await getCookie(CLOUD_BASE_URL);
const cookieString = cookie.map(c => `${c.name}=${c.value}`).join('; ');
details.requestHeaders['cookie'] = cookieString;
if (cookie) {
const cookieString = cookie
.map(c => `${c.name}=${c.value}`)
.join('; ');
details.requestHeaders['cookie'] = cookieString;
}
}
callback({
cancel: false,