@@ -46,16 +46,11 @@ export class LottieView extends LottieViewBase {
4646 this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithJson ( src ) ;
4747 } else if ( src . startsWith ( Utils . RESOURCE_PREFIX ) ) {
4848 const resName = src . replace ( Utils . RESOURCE_PREFIX , '' ) ;
49- if ( resName . endsWith ( '.lottie' ) ) {
50- DotLottie . objcLoadWithNameShouldCacheCompletion ( resName . replace ( '.lottie' , '' ) , true , ( animation ) => {
51- this . nativeViewProtected . animation = animation ;
52- } ) ;
53- } else {
54- this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithNameBundle (
55- resName . replace ( '.json' , '' ) ,
56- NSBundle . mainBundle
57- ) ;
58- }
49+
50+ this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithNameBundle (
51+ resName . replace ( '.json' , '' ) . replace ( '.lottie' , '' ) ,
52+ NSBundle . mainBundle
53+ ) ;
5954 } else {
6055 if ( src [ 0 ] === '~' ) {
6156 src = `${ path . join ( appPath , src . substring ( 2 ) ) } ` ;
@@ -65,14 +60,11 @@ export class LottieView extends LottieViewBase {
6560 }
6661 if ( ! src . startsWith ( 'file:/' ) && src [ 0 ] !== '/' ) {
6762 // seen as res
68- this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithNameBundle (
63+ this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithNameSubdirectoryBundle (
6964 src . replace ( '.json' , '' ) . replace ( '.lottie' , '' ) ,
65+ null ,
7066 NSBundle . mainBundle
7167 ) ;
72- } else if ( src . endsWith ( '.lottie' ) ) {
73- DotLottie . objcLoadFromShouldCacheCompletion ( NSURL . URLWithString ( src ) , true , ( animation ) => {
74- this . nativeViewProtected . animation = animation ;
75- } ) ;
7668 } else {
7769 this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithFilepath ( src ) ;
7870 }
0 commit comments