mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix numerous test fails because of unitialized user settings scope on the test environment
GitOrigin-RevId: a27454285b0c89c6abef560f05c52d35f81fa570
This commit is contained in:
parent
56395d9a95
commit
5597736057
2 changed files with 21 additions and 21 deletions
|
@ -23,25 +23,25 @@ type ProjectSettingsContextValue = {
|
|||
setRootDocId: (rootDocId: string) => void
|
||||
spellCheckLanguage?: string
|
||||
setSpellCheckLanguage: (spellCheckLanguage: string) => void
|
||||
autoComplete: boolean
|
||||
autoComplete?: boolean
|
||||
setAutoComplete: (autoComplete: boolean) => void
|
||||
autoPairDelimiters: boolean
|
||||
autoPairDelimiters?: boolean
|
||||
setAutoPairDelimiters: (autoPairDelimiters: boolean) => void
|
||||
syntaxValidation: boolean
|
||||
syntaxValidation?: boolean
|
||||
setSyntaxValidation: (syntaxValidation: boolean) => void
|
||||
mode: Keybindings
|
||||
mode?: Keybindings
|
||||
setMode: (mode: Keybindings) => void
|
||||
editorTheme: string
|
||||
editorTheme?: string
|
||||
setEditorTheme: (editorTheme: string) => void
|
||||
overallTheme: OverallTheme
|
||||
overallTheme?: OverallTheme
|
||||
setOverallTheme: (overallTheme: OverallTheme) => void
|
||||
fontSize: string
|
||||
fontSize?: string
|
||||
setFontSize: (fontSize: string) => void
|
||||
fontFamily: FontFamily
|
||||
fontFamily?: FontFamily
|
||||
setFontFamily: (fontFamily: FontFamily) => void
|
||||
lineHeight: LineHeight
|
||||
lineHeight?: LineHeight
|
||||
setLineHeight: (lineHeight: LineHeight) => void
|
||||
pdfViewer: PdfViewer
|
||||
pdfViewer?: PdfViewer
|
||||
setPdfViewer: (pdfViewer: PdfViewer) => void
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import type { UserSettingsScope } from '../utils/api'
|
|||
|
||||
export default function useUserWideSettings() {
|
||||
const saveUserSettings = useSaveUserSettings()
|
||||
const [userSettings] = useScopeValue<UserSettingsScope>('settings', true)
|
||||
const [userSettings] = useScopeValue<UserSettingsScope | undefined>('settings', true)
|
||||
|
||||
const setOverallTheme = useSetOverallTheme()
|
||||
const setAutoComplete = useCallback(
|
||||
|
@ -78,25 +78,25 @@ export default function useUserWideSettings() {
|
|||
)
|
||||
|
||||
return {
|
||||
autoComplete: userSettings.autoComplete,
|
||||
autoComplete: userSettings?.autoComplete,
|
||||
setAutoComplete,
|
||||
autoPairDelimiters: userSettings.autoPairDelimiters,
|
||||
autoPairDelimiters: userSettings?.autoPairDelimiters,
|
||||
setAutoPairDelimiters,
|
||||
syntaxValidation: userSettings.syntaxValidation,
|
||||
syntaxValidation: userSettings?.syntaxValidation,
|
||||
setSyntaxValidation,
|
||||
editorTheme: userSettings.editorTheme,
|
||||
editorTheme: userSettings?.editorTheme,
|
||||
setEditorTheme,
|
||||
overallTheme: userSettings.overallTheme,
|
||||
overallTheme: userSettings?.overallTheme,
|
||||
setOverallTheme,
|
||||
mode: userSettings.mode,
|
||||
mode: userSettings?.mode,
|
||||
setMode,
|
||||
fontSize: userSettings.fontSize,
|
||||
fontSize: userSettings?.fontSize,
|
||||
setFontSize,
|
||||
fontFamily: userSettings.fontFamily,
|
||||
fontFamily: userSettings?.fontFamily,
|
||||
setFontFamily,
|
||||
lineHeight: userSettings.lineHeight,
|
||||
lineHeight: userSettings?.lineHeight,
|
||||
setLineHeight,
|
||||
pdfViewer: userSettings.pdfViewer,
|
||||
pdfViewer: userSettings?.pdfViewer,
|
||||
setPdfViewer,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue