mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-12 17:36:10 +00:00
Merge pull request #4042 from overleaf/as-prevent-set-title
Prevent setting title on every render GitOrigin-RevId: d9e5ad7d7a23099f153686f538ab3e733b3b7b07
This commit is contained in:
parent
fefb588d71
commit
2abc9fa0e8
1 changed files with 6 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { createContext, useCallback, useContext } from 'react'
|
||||
import React, { createContext, useCallback, useContext, useEffect } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import useScopeValue from './util/scope-value-hook'
|
||||
import { useApplicationContext } from './application-context'
|
||||
|
@ -98,9 +98,11 @@ export function EditorProvider({ children, ide, settings }) {
|
|||
)
|
||||
|
||||
const { setTitle } = useBrowserWindow()
|
||||
setTitle(
|
||||
`${projectName ? projectName + ' - ' : ''}Online LaTeX Editor ${appName}`
|
||||
)
|
||||
useEffect(() => {
|
||||
setTitle(
|
||||
`${projectName ? projectName + ' - ' : ''}Online LaTeX Editor ${appName}`
|
||||
)
|
||||
}, [appName, projectName, setTitle])
|
||||
|
||||
const editorContextValue = {
|
||||
cobranding,
|
||||
|
|
Loading…
Add table
Reference in a new issue