From 6617bbb3b07bf507cbd56cc8212be25105d3aea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Wed, 20 May 2020 13:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20type:=20fix=20ts=20error=20in=20?= =?UTF-8?q?3.9=20(#6632)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔥 type: fix ts error in 3.9 * use node@12 --- azure-pipelines.yml | 4 ++-- src/components/NoticeIcon/index.tsx | 2 +- src/models/global.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3dc0f93f..61d31f3f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,7 +50,7 @@ jobs: steps: - task: NodeTool@0 inputs: - versionSpec: '11.x' + versionSpec: '12.x' - script: yarn displayName: install - script: npm run lint @@ -73,7 +73,7 @@ jobs: steps: - task: NodeTool@0 inputs: - versionSpec: '11.x' + versionSpec: '12.x' - script: yarn displayName: install - script: npm run lint diff --git a/src/components/NoticeIcon/index.tsx b/src/components/NoticeIcon/index.tsx index c4b001fc..f91740e0 100644 --- a/src/components/NoticeIcon/index.tsx +++ b/src/components/NoticeIcon/index.tsx @@ -69,6 +69,7 @@ const NoticeIcon: React.FC & { panes.push( & { showClear={showClear} showViewMore={showViewMore} title={title} - {...child.props} /> , ); diff --git a/src/models/global.ts b/src/models/global.ts index 3bdfaeb2..5d4c4e40 100644 --- a/src/models/global.ts +++ b/src/models/global.ts @@ -116,8 +116,8 @@ const GlobalModel: GlobalModelType = { }, saveClearedNotices(state = { notices: [], collapsed: true }, { payload }): GlobalModelState { return { - collapsed: false, ...state, + collapsed: false, notices: state.notices.filter((item): boolean => item.type !== payload), }; },