chore: deprecate baseSize state

This commit is contained in:
EnixCoda 2020-04-09 17:10:07 +08:00
parent 252b0e7628
commit 9e0831d8ed
No known key found for this signature in database
GPG key ID: FE06F5DFC1C9B8E4
2 changed files with 2 additions and 8 deletions

View file

@ -22,6 +22,7 @@ import * as keyHelper from 'utils/keyHelper'
const RawGitako: React.FC<Props & ConnectorState> = 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<Props & ConnectorState> = function RawGitako(props) {
errorDueToAuth,
metaData,
treeData: treeRoot,
baseSize,
error,
shouldShow,
showSettings,
@ -132,7 +132,6 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
}
RawGitako.defaultProps = {
baseSize: 260,
shouldShow: false,
showSettings: false,
errorDueToAuth: false,

View file

@ -29,8 +29,6 @@ export type ConnectorState = {
setShouldShow: GetCreatedMethod<typeof setShouldShow>
toggleShowSideBar: GetCreatedMethod<typeof toggleShowSideBar>
toggleShowSettings: GetCreatedMethod<typeof toggleShowSettings>
} & {
baseSize: number
}
type BoundMethodCreator<Args extends any[] = []> = MethodCreator<Props, ConnectorState, Args>
@ -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(