import gql from 'graphql-tag' import { client } from '@operato/graphql' import { updateLayout } from '@operato/layout' import { registerFileUploadLimits } from '@operato/utils' const ENV = process.env const version = ENV['APP-VERSION'] window['appversion@things-factory'] = version export default function bootstrap() { const mql = window.matchMedia('(min-width: 460px)') updateLayout(mql.matches) mql.addEventListener('change', e => updateLayout(e.matches)) /* Every file picker refuses with the limits the server enforces, read on the first pick. */ registerFileUploadLimits(async () => { const response = await client.query({ query: gql`query { fileUploadLimits { maxFileSize maxFiles } }` }) return response.data.fileUploadLimits }) }