fix: improve handling of config and rte plugin
This commit is contained in:
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react"
|
||||
export class SDKLoadingError extends Error {}
|
||||
|
||||
export default function useApp() {
|
||||
const modalElementId = "field"
|
||||
const [, setError] = useState()
|
||||
const [sdk, setSdk] = useState<UiLocation>()
|
||||
const [config, setConfig] = useState<Record<string, string>>()
|
||||
@@ -19,7 +20,7 @@ export default function useApp() {
|
||||
const config = await initSdk.getConfig()
|
||||
setConfig(config)
|
||||
|
||||
const iframeWrapperRef = document.getElementById("field")
|
||||
const iframeWrapperRef = document.getElementById(modalElementId)
|
||||
window.iframeRef = iframeWrapperRef
|
||||
window.postRobot = initSdk.postRobot
|
||||
} catch (e) {
|
||||
@@ -42,5 +43,6 @@ export default function useApp() {
|
||||
return {
|
||||
sdk,
|
||||
config,
|
||||
modalElementId,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user