Fix Communication between frontend and backend (#1201)

Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Philip Molares 2021-05-01 23:01:42 +02:00 committed by GitHub
parent 4a18e51c83
commit 9cf7980334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 268 additions and 164 deletions

View file

@ -7,16 +7,13 @@
import React from 'react'
import { Col, Row } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import links from '../../../../links.json'
import { ApplicationState } from '../../../../redux'
import { TranslatedExternalLink } from '../../../common/links/translated-external-link'
import { TranslatedInternalLink } from '../../../common/links/translated-internal-link'
export const Links: React.FC = () => {
useTranslation()
const backendIssueTracker = useSelector((state: ApplicationState) => state.config.version.issueTrackerUrl)
return (
<Row className={ 'justify-content-center pt-4' }>
<Col lg={ 4 }>
@ -43,7 +40,7 @@ export const Links: React.FC = () => {
<li>
<TranslatedExternalLink
i18nKey='editor.help.contacts.reportIssue'
href={ backendIssueTracker }
href={ links.backendIssues }
icon='tag'
className='text-primary'
/>

View file

@ -8,7 +8,7 @@ import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react
import { useSelector } from 'react-redux'
import { useIsDarkModeActivated } from '../../../hooks/common/use-is-dark-mode-activated'
import { ApplicationState } from '../../../redux'
import { isTestMode } from '../../../utils/is-test-mode'
import { isTestMode } from '../../../utils/test-modes'
import { RendererProps } from '../../render-page/markdown-document'
import { ImageDetails, RendererType } from '../../render-page/rendering-message'
import { useContextOrStandaloneIframeCommunicator } from '../render-context/iframe-communicator-context-provider'
@ -44,7 +44,7 @@ export const RenderIframe: React.FC<RenderIframeProps> = (
const frameReference = useRef<HTMLIFrameElement>(null)
const rendererOrigin = useSelector((state: ApplicationState) => state.config.iframeCommunication.rendererOrigin)
const renderPageUrl = `${ rendererOrigin }/render`
const renderPageUrl = `${ rendererOrigin }render`
const resetRendererReady = useCallback(() => setRendererReady(false), [])
const iframeCommunicator = useContextOrStandaloneIframeCommunicator()
const onIframeLoad = useOnIframeLoad(frameReference, iframeCommunicator, rendererOrigin, renderPageUrl, resetRendererReady)