diff --git a/src/background/core/chrome.ts b/src/background/core/chrome.ts index 49d100fa..d98caebf 100644 --- a/src/background/core/chrome.ts +++ b/src/background/core/chrome.ts @@ -44,9 +44,13 @@ export default { tabs.query({ status: 'complete' }, res => { for (const tab of res) { if (tab.id) { - tabs.sendMessage(tab.id, message, res1 => { - resolve(res1); - }); + try { + tabs.sendMessage(tab.id, message, res1 => { + resolve(res1); + }); + } catch (e) { + // 吞掉抛错 + } } } }); diff --git a/src/components/AccountLayout/Login.module.less b/src/components/AccountLayout/Login.module.less index 1ab5708f..826e1ccd 100644 --- a/src/components/AccountLayout/Login.module.less +++ b/src/components/AccountLayout/Login.module.less @@ -8,6 +8,7 @@ border-left: 1px solid @border-color; background: @white; justify-content: center; + position: relative; .content { padding: 0 70px; @@ -48,4 +49,11 @@ } } } + + .closeWrapper { + position: absolute; + right: 16px; + top: 16px; + color: @text-color-secondary; + } } diff --git a/src/components/AccountLayout/Login.tsx b/src/components/AccountLayout/Login.tsx index a3f8881f..95f5744a 100644 --- a/src/components/AccountLayout/Login.tsx +++ b/src/components/AccountLayout/Login.tsx @@ -7,6 +7,9 @@ import { __i18n } from '@/isomorphic/i18n'; import LinkHelper from '@/isomorphic/link-helper'; import { VERSION } from '@/config'; import YuqueLogo from '@/assets/images/yuque-logo.png'; +import { isRunningInjectPage } from '@/core/uitl'; +import LarkIcon from '../LarkIcon'; +import Typography from '../Typography'; import styles from './Login.module.less'; interface ILoginProps { @@ -39,6 +42,15 @@ function Login(props: ILoginProps) { return (
+ {isRunningInjectPage && ( + backgroundBridge.sidePanel.close()} + > + + + )}
yuque logo diff --git a/src/components/AccountLayout/index.tsx b/src/components/AccountLayout/index.tsx index b5987397..dc324ba9 100644 --- a/src/components/AccountLayout/index.tsx +++ b/src/components/AccountLayout/index.tsx @@ -110,7 +110,7 @@ function AccountLayout(props: IAccountLayoutProps) { return ( - {isLogined ? ( + {isLogined && !forceUpgradeHtml ? ( props.children ) : (