mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
fix(frontend): migrate type changes
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
2f5dadb981
commit
61362f9175
37 changed files with 80 additions and 79 deletions
|
@ -30,7 +30,7 @@ export const MotdModal: React.FC = () => {
|
|||
const { error, loading, value } = useAsync(fetchMotd)
|
||||
const [dismissed, setDismissed] = useState(false)
|
||||
|
||||
const lines = useMemo(() => value?.motdText.split('\n'), [value?.motdText])
|
||||
const lines = useMemo(() => value?.motdText.split('\n') ?? [], [value?.motdText])
|
||||
|
||||
const dismiss = useCallback(() => {
|
||||
if (value?.lastModified) {
|
||||
|
@ -51,7 +51,7 @@ export const MotdModal: React.FC = () => {
|
|||
|
||||
return (
|
||||
<CommonModal
|
||||
show={!!lines && !loading && !error && !dismissed}
|
||||
show={lines.length > 0 && !loading && !error && !dismissed}
|
||||
titleI18nKey={'motd.title'}
|
||||
{...cypressId('motd-modal')}>
|
||||
<Modal.Body>
|
||||
|
@ -59,7 +59,7 @@ export const MotdModal: React.FC = () => {
|
|||
<RendererIframe
|
||||
frameClasses={'w-100'}
|
||||
rendererType={RendererType.SIMPLE}
|
||||
markdownContentLines={lines as string[]}
|
||||
markdownContentLines={lines}
|
||||
adaptFrameHeightToContent={true}
|
||||
showWaitSpinner={true}
|
||||
/>
|
||||
|
|
|
@ -17,7 +17,7 @@ interface LanguageOptionProps {
|
|||
*/
|
||||
export const LanguageOption: React.FC<LanguageOptionProps> = ({ languageCode }) => {
|
||||
const displayName = useMemo(
|
||||
() => new Intl.DisplayNames([languageCode], { type: 'language' }).of(languageCode),
|
||||
() => new Intl.DisplayNames([languageCode], { type: 'language' }).of(languageCode) ?? null,
|
||||
[languageCode]
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue