From 9cec5e269292097da51bb2de59df477b2c32a0e2 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Sun, 23 Sep 2018 13:25:10 +0800 Subject: [PATCH] fix: do not mount icon button when not in repo page --- src/driver/core/SideBar.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/driver/core/SideBar.js b/src/driver/core/SideBar.js index 81a793d..47d427c 100644 --- a/src/driver/core/SideBar.js +++ b/src/driver/core/SideBar.js @@ -7,6 +7,7 @@ import keyHelper from '../../utils/keyHelper' const init = dispatch => async () => { try { if (!URLHelper.isInRepoPage()) return + dispatch({ logoContainerElement: DOMHelper.insertLogoMountPoint() }) let nothingWentWrong = true const metaData = URLHelper.parse() dispatch(setMetaData, metaData) @@ -45,13 +46,8 @@ const init = dispatch => async () => { .catch(err => { dispatch(handleError, err) }) - .then(() => { - dispatch({ logoContainerElement: DOMHelper.insertLogoMountPoint() }) - }) } catch (err) { dispatch(handleError, err) - } finally { - dispatch({ logoContainerElement: DOMHelper.insertLogoMountPoint() }) } }