mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: overwrite header style more aggressive
This commit is contained in:
parent
619d18a6bb
commit
8138a0539a
2 changed files with 7 additions and 3 deletions
|
|
@ -53,6 +53,7 @@ export const init: BoundMethodCreator = dispatch => async () => {
|
|||
dispatch.set({ disabled: true })
|
||||
return
|
||||
}
|
||||
DOMHelper.markGitakoReadyState(true)
|
||||
dispatch.set({
|
||||
errorDueToAuth: false,
|
||||
showSettings: false,
|
||||
|
|
@ -120,7 +121,6 @@ export const init: BoundMethodCreator = dispatch => async () => {
|
|||
const shouldShow =
|
||||
intelligentToggle === null ? URLHelper.isInCodePage(metaData) : intelligentToggle
|
||||
dispatch.call(setShouldShow, shouldShow)
|
||||
DOMHelper.markGitakoReadyState()
|
||||
} catch (err) {
|
||||
dispatch.call(handleError, err)
|
||||
} finally {
|
||||
|
|
@ -141,6 +141,7 @@ export const handleError: BoundMethodCreator<[Error]> = dispatch => async err =>
|
|||
dispatch.set({ errorDueToAuth: true })
|
||||
dispatch.call(setShowSettings, true)
|
||||
} else {
|
||||
DOMHelper.markGitakoReadyState(false)
|
||||
dispatch.call(setError, 'Gitako ate a bug, but it should recovery soon!')
|
||||
throw err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,10 +13,13 @@ NProgress.configure({ showSpinner: false })
|
|||
|
||||
/**
|
||||
* when gitako is ready, make page's header narrower
|
||||
* or cancel it
|
||||
*/
|
||||
export function markGitakoReadyState() {
|
||||
export function markGitakoReadyState(ready: boolean) {
|
||||
const readyClassName = 'gitako-ready'
|
||||
document.body.classList.add(readyClassName)
|
||||
const classList = document.body.classList
|
||||
if (ready) classList.add(readyClassName)
|
||||
else classList.remove(readyClassName)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue