@@ -18,12 +18,13 @@ import { startSentry } from '@shared/utils/sentry';
1818import { showError } from '@shared/utils/showError' ;
1919import { navigate } from '@shared/utils/svelte/ui' ;
2020import { FrameElement , PageElement , createElement , registerElement , registerNativeViewElement } from 'svelte-native/dom' ;
21- import PacksList from '~/components/App.svelte' ;
21+ import App from '~/components/App.svelte' ;
2222import { getBGServiceInstance } from '~/services/BgService' ;
2323import { setDocumentsService } from './models/Pack' ;
2424import { networkService } from './services/api' ;
2525import { createSharedDocumentsService , documentsService } from './services/documents' ;
2626import { importService } from './services/importservice' ;
27+ import { svelteNativeNoFrame } from 'svelte-native' ;
2728// import './app.scss';
2829declare module '@nativescript/core/application/application-common' {
2930 interface ApplicationCommon {
@@ -161,45 +162,46 @@ try {
161162 }
162163 } ) ;
163164 sharedInit ( ) ;
165+ svelteNativeNoFrame ( App , { } ) ;
164166
165- let rootFrame ;
166- let pageInstance ;
167- // we use custom start cause we want gesturerootview as parent of it all to add snacK message view
168- new Promise ( ( resolve , reject ) => {
169- //wait for launch
170- Application . on ( Application . launchEvent , ( ) => {
171- DEV_LOG && console . log ( 'launch' , ! ! pageInstance ) ;
172- resolve ( pageInstance ) ;
173- } ) ;
174- Application . on ( Application . exitEvent , ( ) => {
175- DEV_LOG && console . log ( 'exit' , ! ! pageInstance ) ;
176- if ( pageInstance ) {
177- pageInstance . $destroy ( ) ;
178- pageInstance = null ;
179- }
180- } ) ;
181- try {
182- Application . run ( {
183- create : ( ) => {
184- const rootGridLayout = createElement ( 'gesturerootview' , window . document as any ) ;
185- const rootFrame = createElement ( 'frame' , rootGridLayout . ownerDocument ) ;
186- rootFrame . setAttribute ( 'id' , 'app-root-frame' ) ;
187- //very important here to use svelte-native navigate
188- // the throttle one wont return the pageInstance
189- pageInstance = navigate ( {
190- page : PacksList ,
191- props : { } ,
192- frame : rootFrame as any
193- } ) ;
194- DEV_LOG && console . log ( 'Application.run' , ! ! pageInstance ) ;
195- rootGridLayout . appendChild ( rootFrame ) ;
196- return rootGridLayout [ 'nativeView' ] ;
197- }
198- } ) ;
199- } catch ( e ) {
200- reject ( e ) ;
201- }
202- } ) ;
167+ // let rootFrame;
168+ // let pageInstance;
169+ // // we use custom start cause we want gesturerootview as parent of it all to add snacK message view
170+ // new Promise((resolve, reject) => {
171+ // //wait for launch
172+ // Application.on(Application.launchEvent, () => {
173+ // DEV_LOG && console.log('launch', !!pageInstance);
174+ // resolve(pageInstance);
175+ // });
176+ // Application.on(Application.exitEvent, () => {
177+ // DEV_LOG && console.log('exit', !!pageInstance);
178+ // if (pageInstance) {
179+ // pageInstance.$destroy();
180+ // pageInstance = null;
181+ // }
182+ // });
183+ // try {
184+ // Application.run({
185+ // create: () => {
186+ // const rootGridLayout = createElement('gesturerootview', window.document as any);
187+ // const rootFrame = createElement('frame', rootGridLayout.ownerDocument);
188+ // rootFrame.setAttribute('id', 'app-root-frame');
189+ // //very important here to use svelte-native navigate
190+ // // the throttle one wont return the pageInstance
191+ // pageInstance = navigate({
192+ // page: App ,
193+ // props: {},
194+ // frame: rootFrame as any
195+ // });
196+ // DEV_LOG && console.log('Application.run', !!pageInstance);
197+ // rootGridLayout.appendChild(rootFrame);
198+ // return rootGridLayout['nativeView'];
199+ // }
200+ // });
201+ // } catch (e) {
202+ // reject(e);
203+ // }
204+ // });
203205} catch ( error ) {
204206 console . error ( error , error . stack ) ;
205207}
0 commit comments