mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: intelligent toggle
This commit is contained in:
parent
8138a0539a
commit
b71a97e11f
1 changed files with 13 additions and 9 deletions
|
|
@ -50,15 +50,19 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
[props.disabled, configContext.val.shortcut],
|
||||
)
|
||||
|
||||
useOnLocationChange(() => {
|
||||
if (configContext.val.intelligentToggle === null) {
|
||||
props.setShouldShow(
|
||||
URLHelper.isInCodePage({
|
||||
branchName: props.metaData?.branchName,
|
||||
}),
|
||||
)
|
||||
}
|
||||
}, [props.metaData?.branchName, configContext.val.intelligentToggle])
|
||||
const updateSideBarVisibility = React.useCallback(
|
||||
function updateSideBarVisibility() {
|
||||
if (configContext.val.intelligentToggle === null) {
|
||||
props.setShouldShow(
|
||||
URLHelper.isInCodePage({
|
||||
branchName: props.metaData?.branchName,
|
||||
}),
|
||||
)
|
||||
}
|
||||
},
|
||||
[props.metaData?.branchName, configContext.val.intelligentToggle],
|
||||
)
|
||||
useEvent('pjax:complete', updateSideBarVisibility, window)
|
||||
|
||||
const attachCopyFileButton = React.useCallback(
|
||||
function attachCopyFileButton() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue