Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function attachCopyFileButton() {
if (configContext.val.copyFileButton) return DOMHelper.attachCopyFileBtn() || undefined // for the sake of react effect
},
[configContext.val.copyFileButton],
)
React.useEffect(attachCopyFileButton, [configContext.val.copyFileButton])
useEvent('pjax:complete', attachCopyFileButton, window)
const attachCopySnippetButton = React.useCallback(
function attachCopySnippetButton() {
if (configContext.val.copySnippetButton) return DOMHelper.attachCopySnippet() || undefined // for the sake of react effect
},
[configContext.val.copySnippetButton],
)
React.useEffect(attachCopySnippetButton, [configContext.val.copySnippetButton])
useEvent('pjax:complete', attachCopySnippetButton, window)
// init again when setting new accessToken
useDidUpdate(() => {
props.init()
}, [accessToken])
const {
errorDueToAuth,
metaData,
treeData,
baseSize,
error,
shouldShow,
showSettings,
logoContainerElement,
toggleShowSideBar,
}),
)
}
},
[props.metaData?.branchName, configContext.val.intelligentToggle],
)
useEvent('pjax:complete', updateSideBarVisibility, window)
const attachCopyFileButton = React.useCallback(
function attachCopyFileButton() {
if (configContext.val.copyFileButton) return DOMHelper.attachCopyFileBtn() || undefined // for the sake of react effect
},
[configContext.val.copyFileButton],
)
React.useEffect(attachCopyFileButton, [configContext.val.copyFileButton])
useEvent('pjax:complete', attachCopyFileButton, window)
const attachCopySnippetButton = React.useCallback(
function attachCopySnippetButton() {
if (configContext.val.copySnippetButton) return DOMHelper.attachCopySnippet() || undefined // for the sake of react effect
},
[configContext.val.copySnippetButton],
)
React.useEffect(attachCopySnippetButton, [configContext.val.copySnippetButton])
useEvent('pjax:complete', attachCopySnippetButton, window)
// init again when setting new accessToken
useDidUpdate(() => {
props.init()
}, [accessToken])
const {
[props.disabled, configContext.val.shortcut],
)
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() {
if (configContext.val.copyFileButton) return DOMHelper.attachCopyFileBtn() || undefined // for the sake of react effect
},
[configContext.val.copyFileButton],
)
React.useEffect(attachCopyFileButton, [configContext.val.copyFileButton])
useEvent('pjax:complete', attachCopyFileButton, window)
const attachCopySnippetButton = React.useCallback(
function attachCopySnippetButton() {
if (configContext.val.copySnippetButton) return DOMHelper.attachCopySnippet() || undefined // for the sake of react effect
},
[configContext.val.copySnippetButton],
)