Rebase on master and fixes for typescript
This commit is contained in:
parent
a7186c6f6e
commit
2b28d8c24a
|
@ -9,16 +9,21 @@ import { CloseIcon } from './icon.component'
|
|||
|
||||
interface ModalWebViewProps {
|
||||
url: string
|
||||
sharedCookiesEnabled: boolean
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
export const ModalWebView = ({ url, onClose }: ModalWebViewProps) => {
|
||||
export const ModalWebView = ({
|
||||
url,
|
||||
onClose,
|
||||
sharedCookiesEnabled,
|
||||
}: ModalWebViewProps) => {
|
||||
const [modalVisible, setModalVisible] = React.useState(true)
|
||||
const { api } = useApi()
|
||||
const [headers, setHeaders] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getHeaders = async (urlToGetSessionFor) => {
|
||||
const getHeaders = async (urlToGetSessionFor: string) => {
|
||||
if (sharedCookiesEnabled) return
|
||||
const { headers: newHeaders } = await api.getSession(urlToGetSessionFor)
|
||||
setHeaders(newHeaders)
|
||||
|
|
|
@ -19,9 +19,9 @@ export const Notification = ({ item }: NotificationProps) => {
|
|||
? moment(item.dateCreated).fromNow()
|
||||
: null
|
||||
|
||||
const sharedCookiesEnabled = () => {
|
||||
return item.url && item.url.startsWith('https://start.unikum.net/')
|
||||
}
|
||||
const sharedCookiesEnabled: boolean = Boolean(
|
||||
item.url && item.url.startsWith('https://start.unikum.net/')
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -45,7 +45,7 @@ export const Notification = ({ item }: NotificationProps) => {
|
|||
<ModalWebView
|
||||
url={item.url}
|
||||
onClose={close}
|
||||
sharedCookiesEnabled={sharedCookiesEnabled()}
|
||||
sharedCookiesEnabled={sharedCookiesEnabled}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
Loading…
Reference in New Issue