mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: resolve return value for effects
This commit is contained in:
parent
6f4c26d36b
commit
26d0b189bc
1 changed files with 5 additions and 3 deletions
|
|
@ -72,15 +72,17 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
}, [props.metaData, configContext.val.intelligentToggle])
|
||||
|
||||
React.useEffect(() => {
|
||||
if (configContext.val.copyFileButton) return DOMHelper.attachCopyFileBtn()
|
||||
if (configContext.val.copyFileButton) return DOMHelper.attachCopyFileBtn() || undefined // undefined is friendlier to React
|
||||
}, [configContext.val.copyFileButton])
|
||||
|
||||
React.useEffect(() => {
|
||||
if (configContext.val.copySnippetButton) return DOMHelper.attachCopySnippet()
|
||||
if (configContext.val.copySnippetButton) return DOMHelper.attachCopySnippet() || undefined // undefined is friendlier to React
|
||||
}, [configContext.val.copySnippetButton])
|
||||
|
||||
// init again when setting new accessToken
|
||||
useDidUpdate(() => props.init(), [accessToken])
|
||||
useDidUpdate(() => {
|
||||
props.init()
|
||||
}, [accessToken])
|
||||
|
||||
const {
|
||||
errorDueToAuth,
|
||||
|
|
|
|||
Loading…
Reference in a new issue