Send mobile editor email (#634)

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2024-12-12 15:49:09 +05:30
committed by GitHub
parent ea4cd85eae
commit 20405ee606
4 changed files with 78 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ import { captureException } from "@sentry/core"
import FormSettings from './form-components/FormSettings.vue'
import FormEditorErrorHandler from '~/components/open/forms/components/FormEditorErrorHandler.vue'
import { setFormDefaults } from '~/composables/forms/initForm.js'
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
export default {
name: "FormEditor",
@@ -145,6 +146,16 @@ export default {
emits: ['mounted', 'on-save', 'openRegister', 'go-back', 'save-form'],
setup() {
// Check if the editor is visible on smaller screens then send an email
const breakpoints = useBreakpoints(breakpointsTailwind)
const isVisible = ref(breakpoints.smaller("md"))
watch(isVisible, (newValue) => {
if (newValue) {
opnFetch('/open/forms/' + form.value.id + '/mobile-editor-email')
}
})
const { user } = storeToRefs(useAuthStore())
const formsStore = useFormsStore()
const { content: form } = storeToRefs(useWorkingFormStore())