feat(core): avoid popup window being blocked (#6451)

This commit is contained in:
liuyi
2024-04-03 16:50:09 +08:00
committed by GitHub
parent 3e9e2ce93b
commit 6fa4b7da54
14 changed files with 78 additions and 28 deletions
@@ -7,7 +7,7 @@ import { atomWithObservable, atomWithStorage } from 'jotai/utils';
import { useCallback, useState } from 'react';
import { Observable } from 'rxjs';
import { mixpanel } from '../utils';
import { mixpanel, popupWindow } from '../utils';
import { useAsyncCallback } from './affine-async-hooks';
function rpcToObservable<
@@ -191,7 +191,7 @@ export const useAppUpdater = () => {
mixpanel.track('Button', {
resolve: 'OpenChangelog',
});
window.open(runtimeConfig.changelogUrl, '_blank');
popupWindow(runtimeConfig.changelogUrl);
await setChangelogUnread(true);
}, [setChangelogUnread]);