ui: 移除延迟设置应用视图大小
This commit is contained in:
@@ -26,13 +26,13 @@ import AppMobile from './ui/AppMobile.tsx'
|
|||||||
import isMobileUI from "./ui/isMobileUI.ts"
|
import isMobileUI from "./ui/isMobileUI.ts"
|
||||||
ReactDOM.createRoot(document.getElementById('app') as HTMLElement).render(React.createElement(isMobileUI() ? AppMobile : App, null))
|
ReactDOM.createRoot(document.getElementById('app') as HTMLElement).render(React.createElement(isMobileUI() ? AppMobile : App, null))
|
||||||
|
|
||||||
const onResize = () => setTimeout(() => {
|
const onResize = () => {
|
||||||
document.body.style.setProperty('--whitesilk-widget-message-maxwidth', breakpoint().down('md') ? "80%" : "70%")
|
document.body.style.setProperty('--whitesilk-widget-message-maxwidth', breakpoint().down('md') ? "80%" : "70%")
|
||||||
// deno-lint-ignore no-window
|
// deno-lint-ignore no-window
|
||||||
document.body.style.setProperty('--whitesilk-window-width', window.innerWidth + 'px')
|
document.body.style.setProperty('--whitesilk-window-width', window.innerWidth + 'px')
|
||||||
// deno-lint-ignore no-window
|
// deno-lint-ignore no-window
|
||||||
document.body.style.setProperty('--whitesilk-window-height', window.innerHeight + 'px')
|
document.body.style.setProperty('--whitesilk-window-height', window.innerHeight + 'px')
|
||||||
}, 100)
|
}
|
||||||
// deno-lint-ignore no-window no-window-prefix
|
// deno-lint-ignore no-window no-window-prefix
|
||||||
window.addEventListener('resize', onResize)
|
window.addEventListener('resize', onResize)
|
||||||
onResize()
|
onResize()
|
||||||
Reference in New Issue
Block a user