diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index 57b94c7..e61a187 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -22,6 +22,7 @@ import * as keyHelper from 'utils/keyHelper' const RawGitako: React.FC = function RawGitako(props) { const configContext = useConfigs() const accessToken = props.configContext.val.access_token + const [baseSize] = React.useState(() => configContext.val.sideBarWidth) const intelligentToggle = configContext.val.intelligentToggle React.useEffect(() => { @@ -88,7 +89,6 @@ const RawGitako: React.FC = function RawGitako(props) { errorDueToAuth, metaData, treeData: treeRoot, - baseSize, error, shouldShow, showSettings, @@ -132,7 +132,6 @@ const RawGitako: React.FC = function RawGitako(props) { } RawGitako.defaultProps = { - baseSize: 260, shouldShow: false, showSettings: false, errorDueToAuth: false, diff --git a/src/driver/core/SideBar.ts b/src/driver/core/SideBar.ts index 4064d77..1d8535e 100644 --- a/src/driver/core/SideBar.ts +++ b/src/driver/core/SideBar.ts @@ -29,8 +29,6 @@ export type ConnectorState = { setShouldShow: GetCreatedMethod toggleShowSideBar: GetCreatedMethod toggleShowSettings: GetCreatedMethod -} & { - baseSize: number } type BoundMethodCreator = MethodCreator @@ -62,10 +60,7 @@ export const init: BoundMethodCreator = dispatch => async () => { dispatch.call(setMetaData, metaData) const [, { configContext }] = dispatch.get() - const { sideBarWidth, access_token: accessToken, intelligentToggle } = configContext.val - dispatch.set({ - baseSize: sideBarWidth, - }) + const { access_token: accessToken } = configContext.val if (!metaData.branchName || !metaData.userName || !metaData.repoName) return const getTreeDataAggressively = platform.getTreeData(