mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: did not listen to config changes
This commit is contained in:
parent
eddc53e7ae
commit
a0f1882799
1 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import { SideBarCore } from 'driver/core'
|
|||
import { ConnectorState, Props } from 'driver/core/SideBar'
|
||||
import { oauth } from 'env'
|
||||
import * as React from 'react'
|
||||
import { useEffectOnce, useEvent, useLocation } from 'react-use'
|
||||
import { useEvent, useLocation } from 'react-use'
|
||||
import { cx } from 'utils/cx'
|
||||
import * as DOMHelper from 'utils/DOMHelper'
|
||||
import { JSONRequest, parseURLSearch } from 'utils/general'
|
||||
|
|
@ -66,7 +66,7 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
},
|
||||
[configContext.val.copyFileButton],
|
||||
)
|
||||
useEffectOnce(attachCopyFileButton)
|
||||
React.useEffect(attachCopyFileButton, [configContext.val.copyFileButton])
|
||||
useEvent('pjax:complete', attachCopyFileButton, window)
|
||||
|
||||
const attachCopySnippetButton = React.useCallback(
|
||||
|
|
@ -75,7 +75,7 @@ const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
|||
},
|
||||
[configContext.val.copySnippetButton],
|
||||
)
|
||||
useEffectOnce(attachCopySnippetButton)
|
||||
React.useEffect(attachCopySnippetButton, [configContext.val.copySnippetButton])
|
||||
useEvent('pjax:complete', attachCopySnippetButton, window)
|
||||
|
||||
// init again when setting new accessToken
|
||||
|
|
|
|||
Loading…
Reference in a new issue