You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
434 B
17 lines
434 B
interface HandleViewportSwitchOptions {
|
|
currentIsMobile: boolean
|
|
nextIsMobile: boolean
|
|
hasMountedEditor: boolean
|
|
remountEditor: () => void
|
|
}
|
|
|
|
export function handlePostBodyMarkdownEditorViewportSwitch(options: HandleViewportSwitchOptions): boolean {
|
|
if (options.currentIsMobile === options.nextIsMobile) {
|
|
return false
|
|
}
|
|
if (!options.hasMountedEditor) {
|
|
return true
|
|
}
|
|
options.remountEditor()
|
|
return true
|
|
}
|
|
|