@amityco/react-native-social-uikit 4.1.1-fe2678f6.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/lib/commonjs/core/assets/icons/post.js +1 -1
- package/lib/commonjs/core/assets/icons/post.js.map +1 -1
- package/lib/commonjs/core/assets/icons/story.js +1 -1
- package/lib/commonjs/core/assets/icons/story.js.map +1 -1
- package/lib/commonjs/core/assets/icons/xml.js +16 -2
- package/lib/commonjs/core/assets/icons/xml.js.map +1 -1
- package/lib/commonjs/core/legacy/file.js +145 -62
- package/lib/commonjs/core/legacy/file.js.map +1 -1
- package/lib/commonjs/core/stores/slices/feedSlice.js +3 -0
- package/lib/commonjs/core/stores/slices/feedSlice.js.map +1 -1
- package/lib/commonjs/core/stores/slices/globalfeedSlice.js +5 -0
- package/lib/commonjs/core/stores/slices/globalfeedSlice.js.map +1 -1
- package/lib/commonjs/core/stores/slices/localVideoThumbnailSlice.js +46 -0
- package/lib/commonjs/core/stores/slices/localVideoThumbnailSlice.js.map +1 -0
- package/lib/commonjs/core/stores/slices/uiSlice.js +5 -1
- package/lib/commonjs/core/stores/slices/uiSlice.js.map +1 -1
- package/lib/commonjs/core/stores/store/index.js +3 -1
- package/lib/commonjs/core/stores/store/index.js.map +1 -1
- package/lib/commonjs/social/components/LoadingImage/index.js +73 -12
- package/lib/commonjs/social/components/LoadingImage/index.js.map +1 -1
- package/lib/commonjs/social/components/LoadingImage/styles.js +8 -3
- package/lib/commonjs/social/components/LoadingImage/styles.js.map +1 -1
- package/lib/commonjs/social/components/LoadingVideo/index.js +90 -16
- package/lib/commonjs/social/components/LoadingVideo/index.js.map +1 -1
- package/lib/commonjs/social/components/LoadingVideo/styles.js +14 -5
- package/lib/commonjs/social/components/LoadingVideo/styles.js.map +1 -1
- package/lib/commonjs/social/components/MediaViewer/MediaViewer.js +13 -13
- package/lib/commonjs/social/components/MediaViewer/MediaViewer.js.map +1 -1
- package/lib/commonjs/social/components/MediaViewer/styles.js +11 -1
- package/lib/commonjs/social/components/MediaViewer/styles.js.map +1 -1
- package/lib/commonjs/social/components/PostContent/index.js +8 -29
- package/lib/commonjs/social/components/PostContent/index.js.map +1 -1
- package/lib/commonjs/social/components/SelectedMediaComponent/SelectedMediaComponent.js +109 -17
- package/lib/commonjs/social/components/SelectedMediaComponent/SelectedMediaComponent.js.map +1 -1
- package/lib/commonjs/social/components/legacy/LoadingVideo/index.js +17 -6
- package/lib/commonjs/social/components/legacy/LoadingVideo/index.js.map +1 -1
- package/lib/commonjs/social/elements/PostMediaElement/PostMediaElement.js +121 -23
- package/lib/commonjs/social/elements/PostMediaElement/PostMediaElement.js.map +1 -1
- package/lib/commonjs/social/elements/PostMediaElement/styles.js +7 -0
- package/lib/commonjs/social/elements/PostMediaElement/styles.js.map +1 -1
- package/lib/commonjs/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.js +11 -5
- package/lib/commonjs/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.js.map +1 -1
- package/lib/commonjs/social/features/feed/components/NewsFeed/NewsFeed.js +14 -0
- package/lib/commonjs/social/features/feed/components/NewsFeed/NewsFeed.js.map +1 -1
- package/lib/commonjs/social/features/post/Composer/PostComposer.js +234 -86
- package/lib/commonjs/social/features/post/Composer/PostComposer.js.map +1 -1
- package/lib/commonjs/social/hooks/index.js +11 -0
- package/lib/commonjs/social/hooks/index.js.map +1 -1
- package/lib/commonjs/social/hooks/useCommunities.js +5 -3
- package/lib/commonjs/social/hooks/useCommunities.js.map +1 -1
- package/lib/commonjs/social/hooks/useCommunityPermission.js +43 -0
- package/lib/commonjs/social/hooks/useCommunityPermission.js.map +1 -0
- package/lib/commonjs/social/hooks/useCustomRankingGlobalFeed.js +10 -1
- package/lib/commonjs/social/hooks/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/commonjs/social/hooks/useFile.js +11 -0
- package/lib/commonjs/social/hooks/useFile.js.map +1 -1
- package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +18 -7
- package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/commonjs/social/utils/mediaAttachments.js +150 -0
- package/lib/commonjs/social/utils/mediaAttachments.js.map +1 -0
- package/lib/commonjs/social/utils/postChildren.js +72 -0
- package/lib/commonjs/social/utils/postChildren.js.map +1 -0
- package/lib/module/core/assets/icons/post.js +1 -1
- package/lib/module/core/assets/icons/post.js.map +1 -1
- package/lib/module/core/assets/icons/story.js +1 -1
- package/lib/module/core/assets/icons/story.js.map +1 -1
- package/lib/module/core/assets/icons/xml.js +13 -0
- package/lib/module/core/assets/icons/xml.js.map +1 -1
- package/lib/module/core/legacy/file.js +145 -62
- package/lib/module/core/legacy/file.js.map +1 -1
- package/lib/module/core/stores/slices/feedSlice.js +3 -0
- package/lib/module/core/stores/slices/feedSlice.js.map +1 -1
- package/lib/module/core/stores/slices/globalfeedSlice.js +5 -0
- package/lib/module/core/stores/slices/globalfeedSlice.js.map +1 -1
- package/lib/module/core/stores/slices/localVideoThumbnailSlice.js +41 -0
- package/lib/module/core/stores/slices/localVideoThumbnailSlice.js.map +1 -0
- package/lib/module/core/stores/slices/uiSlice.js +5 -1
- package/lib/module/core/stores/slices/uiSlice.js.map +1 -1
- package/lib/module/core/stores/store/index.js +3 -1
- package/lib/module/core/stores/store/index.js.map +1 -1
- package/lib/module/social/components/LoadingImage/index.js +74 -14
- package/lib/module/social/components/LoadingImage/index.js.map +1 -1
- package/lib/module/social/components/LoadingImage/styles.js +8 -3
- package/lib/module/social/components/LoadingImage/styles.js.map +1 -1
- package/lib/module/social/components/LoadingVideo/index.js +91 -17
- package/lib/module/social/components/LoadingVideo/index.js.map +1 -1
- package/lib/module/social/components/LoadingVideo/styles.js +14 -5
- package/lib/module/social/components/LoadingVideo/styles.js.map +1 -1
- package/lib/module/social/components/MediaViewer/MediaViewer.js +13 -13
- package/lib/module/social/components/MediaViewer/MediaViewer.js.map +1 -1
- package/lib/module/social/components/MediaViewer/styles.js +11 -1
- package/lib/module/social/components/MediaViewer/styles.js.map +1 -1
- package/lib/module/social/components/PostContent/index.js +8 -29
- package/lib/module/social/components/PostContent/index.js.map +1 -1
- package/lib/module/social/components/SelectedMediaComponent/SelectedMediaComponent.js +110 -18
- package/lib/module/social/components/SelectedMediaComponent/SelectedMediaComponent.js.map +1 -1
- package/lib/module/social/components/legacy/LoadingVideo/index.js +17 -6
- package/lib/module/social/components/legacy/LoadingVideo/index.js.map +1 -1
- package/lib/module/social/elements/PostMediaElement/PostMediaElement.js +123 -25
- package/lib/module/social/elements/PostMediaElement/PostMediaElement.js.map +1 -1
- package/lib/module/social/elements/PostMediaElement/styles.js +7 -0
- package/lib/module/social/elements/PostMediaElement/styles.js.map +1 -1
- package/lib/module/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.js +12 -6
- package/lib/module/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.js.map +1 -1
- package/lib/module/social/features/feed/components/NewsFeed/NewsFeed.js +15 -1
- package/lib/module/social/features/feed/components/NewsFeed/NewsFeed.js.map +1 -1
- package/lib/module/social/features/post/Composer/PostComposer.js +236 -89
- package/lib/module/social/features/post/Composer/PostComposer.js.map +1 -1
- package/lib/module/social/hooks/index.js +1 -0
- package/lib/module/social/hooks/index.js.map +1 -1
- package/lib/module/social/hooks/useCommunities.js +5 -3
- package/lib/module/social/hooks/useCommunities.js.map +1 -1
- package/lib/module/social/hooks/useCommunityPermission.js +37 -0
- package/lib/module/social/hooks/useCommunityPermission.js.map +1 -0
- package/lib/module/social/hooks/useCustomRankingGlobalFeed.js +10 -1
- package/lib/module/social/hooks/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/module/social/hooks/useFile.js +11 -0
- package/lib/module/social/hooks/useFile.js.map +1 -1
- package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +19 -8
- package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
- package/lib/module/social/utils/mediaAttachments.js +139 -0
- package/lib/module/social/utils/mediaAttachments.js.map +1 -0
- package/lib/module/social/utils/postChildren.js +66 -0
- package/lib/module/social/utils/postChildren.js.map +1 -0
- package/lib/typescript/core/assets/icons/xml.d.ts +1 -0
- package/lib/typescript/core/assets/icons/xml.d.ts.map +1 -1
- package/lib/typescript/core/legacy/file.d.ts +32 -0
- package/lib/typescript/core/legacy/file.d.ts.map +1 -1
- package/lib/typescript/core/stores/slices/feedSlice.d.ts.map +1 -1
- package/lib/typescript/core/stores/slices/globalfeedSlice.d.ts.map +1 -1
- package/lib/typescript/core/stores/slices/localVideoThumbnailSlice.d.ts +35 -0
- package/lib/typescript/core/stores/slices/localVideoThumbnailSlice.d.ts.map +1 -0
- package/lib/typescript/core/stores/slices/uiSlice.d.ts +5 -0
- package/lib/typescript/core/stores/slices/uiSlice.d.ts.map +1 -1
- package/lib/typescript/core/stores/store/index.d.ts.map +1 -1
- package/lib/typescript/core/types/mention.d.ts +34 -0
- package/lib/typescript/core/types/mention.d.ts.map +1 -1
- package/lib/typescript/social/components/LoadingImage/index.d.ts +8 -2
- package/lib/typescript/social/components/LoadingImage/index.d.ts.map +1 -1
- package/lib/typescript/social/components/LoadingImage/styles.d.ts.map +1 -1
- package/lib/typescript/social/components/LoadingVideo/index.d.ts +9 -2
- package/lib/typescript/social/components/LoadingVideo/index.d.ts.map +1 -1
- package/lib/typescript/social/components/LoadingVideo/styles.d.ts +1 -0
- package/lib/typescript/social/components/LoadingVideo/styles.d.ts.map +1 -1
- package/lib/typescript/social/components/MediaViewer/MediaViewer.d.ts.map +1 -1
- package/lib/typescript/social/components/MediaViewer/styles.d.ts +1 -0
- package/lib/typescript/social/components/MediaViewer/styles.d.ts.map +1 -1
- package/lib/typescript/social/components/PostContent/index.d.ts.map +1 -1
- package/lib/typescript/social/components/SelectedMediaComponent/SelectedMediaComponent.d.ts +2 -2
- package/lib/typescript/social/components/SelectedMediaComponent/SelectedMediaComponent.d.ts.map +1 -1
- package/lib/typescript/social/components/legacy/LoadingVideo/index.d.ts.map +1 -1
- package/lib/typescript/social/elements/PostMediaElement/PostMediaElement.d.ts.map +1 -1
- package/lib/typescript/social/elements/PostMediaElement/styles.d.ts +4 -0
- package/lib/typescript/social/elements/PostMediaElement/styles.d.ts.map +1 -1
- package/lib/typescript/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.d.ts.map +1 -1
- package/lib/typescript/social/features/feed/components/NewsFeed/NewsFeed.d.ts.map +1 -1
- package/lib/typescript/social/features/post/Composer/PostComposer.d.ts.map +1 -1
- package/lib/typescript/social/hooks/index.d.ts +1 -0
- package/lib/typescript/social/hooks/index.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useCommunities.d.ts +2 -1
- package/lib/typescript/social/hooks/useCommunities.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useCommunityPermission.d.ts +14 -0
- package/lib/typescript/social/hooks/useCommunityPermission.d.ts.map +1 -0
- package/lib/typescript/social/hooks/useCustomRankingGlobalFeed.d.ts.map +1 -1
- package/lib/typescript/social/hooks/useFile.d.ts +11 -0
- package/lib/typescript/social/hooks/useFile.d.ts.map +1 -1
- package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
- package/lib/typescript/social/utils/mediaAttachments.d.ts +91 -0
- package/lib/typescript/social/utils/mediaAttachments.d.ts.map +1 -0
- package/lib/typescript/social/utils/postChildren.d.ts +38 -0
- package/lib/typescript/social/utils/postChildren.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/core/assets/icons/post.tsx +1 -1
- package/src/core/assets/icons/story.tsx +1 -1
- package/src/core/assets/icons/xml.ts +15 -0
- package/src/core/legacy/file.tsx +169 -84
- package/src/core/stores/slices/feedSlice.ts +3 -0
- package/src/core/stores/slices/globalfeedSlice.ts +5 -0
- package/src/core/stores/slices/localVideoThumbnailSlice.ts +58 -0
- package/src/core/stores/slices/uiSlice.ts +8 -0
- package/src/core/stores/store/index.ts +2 -0
- package/src/core/types/mention.ts +34 -0
- package/src/social/components/LoadingImage/index.tsx +81 -12
- package/src/social/components/LoadingImage/styles.ts +8 -3
- package/src/social/components/LoadingVideo/index.tsx +111 -21
- package/src/social/components/LoadingVideo/styles.ts +13 -4
- package/src/social/components/MediaViewer/MediaViewer.tsx +11 -12
- package/src/social/components/MediaViewer/styles.ts +9 -1
- package/src/social/components/PostContent/index.tsx +3 -35
- package/src/social/components/SelectedMediaComponent/SelectedMediaComponent.tsx +103 -13
- package/src/social/components/legacy/LoadingVideo/index.tsx +26 -15
- package/src/social/elements/PostMediaElement/PostMediaElement.tsx +139 -29
- package/src/social/elements/PostMediaElement/styles.ts +7 -0
- package/src/social/features/community/PendingRequest/components/PendingPostList/PendingPostList.tsx +11 -6
- package/src/social/features/feed/components/NewsFeed/NewsFeed.tsx +16 -1
- package/src/social/features/post/Composer/PostComposer.tsx +304 -91
- package/src/social/hooks/index.ts +1 -0
- package/src/social/hooks/useCommunities.ts +4 -2
- package/src/social/hooks/useCommunityPermission.ts +40 -0
- package/src/social/hooks/useCustomRankingGlobalFeed.ts +8 -1
- package/src/social/hooks/useFile.ts +11 -0
- package/src/social/screens/CommunityProfile/components/Header/Header.tsx +19 -10
- package/src/social/utils/mediaAttachments.ts +158 -0
- package/src/social/utils/postChildren.ts +85 -0
|
@@ -46,6 +46,11 @@ const globalFeedSlice = createSlice({
|
|
|
46
46
|
postDetail
|
|
47
47
|
} = action.payload;
|
|
48
48
|
const index = state.postList.findIndex(item => !isAmityAd(item) && item.postId === postId);
|
|
49
|
+
// A post edited from a feed this list never held (a community feed, say)
|
|
50
|
+
// is simply not here. Without this guard the -1 miss was written as a
|
|
51
|
+
// "-1" property on the array: the real entries stayed stale and nothing
|
|
52
|
+
// reported a failure.
|
|
53
|
+
if (index < 0) return;
|
|
49
54
|
state.postList[index] = postDetail;
|
|
50
55
|
},
|
|
51
56
|
deleteByPostId: (state, action) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlice","isAmityAd","initialState","postList","paginationData","next","previous","globalFeedSlice","name","reducers","setNewGlobalFeed","state","action","seen","Set","payload","filter","post","has","postId","add","updateGlobalFeed","uniqueIds","map","adId","newUnique","id","push","setPaginationData","addPostToGlobalFeed","alreadyExists","some","item","updateByPostId","postDetail","index","findIndex","deleteByPostId","prevPostList","updatedPostList","clearFeed"],"sourceRoot":"../../../../../src","sources":["core/stores/slices/globalfeedSlice.ts"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,kBAAkB;AAC7D,SAASC,SAAS,QAAQ,kDAAkD;AAS5E,MAAMC,YAA6B,GAAG;EACpCC,QAAQ,EAAE,EAAE;EACZC,cAAc,EAAE;IACdC,IAAI,EAAE,IAAI;IACVC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,MAAMC,eAAe,GAAGP,WAAW,CAAC;EAClCQ,IAAI,EAAE,YAAY;EAClBN,YAAY;EACZO,QAAQ,EAAE;IACRC,gBAAgB,EAAEA,CAACC,KAAK,EAAEC,MAAwC,KAAK;MACrE,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;MAC9BH,KAAK,CAACR,QAAQ,GAAGS,MAAM,CAACG,OAAO,CAACC,MAAM,CAAEC,IAAI,IAAK;QAC/C,IAAIJ,IAAI,CAACK,GAAG,CAACD,IAAI,CAACE,MAAM,CAAC,EAAE,OAAO,KAAK;QACvCN,IAAI,CAACO,GAAG,CAACH,IAAI,CAACE,MAAM,CAAC;QACrB,OAAO,IAAI;MACb,CAAC,CAAC;IACJ,CAAC;IACDE,gBAAgB,EAAEA,CAACV,KAAK,EAAEC,MAAwC,KAAK;MACrE,MAAMU,SAAS,GAAG,IAAIR,GAAG,CACvBH,KAAK,CAACR,QAAQ,CAACoB,GAAG,CAAEN,IAAI,IACtBhB,SAAS,CAACgB,IAAI,CAAC,GAAGA,IAAI,CAACO,IAAI,GAAGP,IAAI,CAACE,MACrC,CACF,CAAC;MACD,MAAMM,SAAyC,GAAG,EAAE;MACpD,KAAK,MAAMR,IAAI,IAAIL,MAAM,CAACG,OAAO,EAAE;QACjC,MAAMW,EAAE,GAAGzB,SAAS,CAACgB,IAAI,CAAC,GAAGA,IAAI,CAACO,IAAI,GAAGP,IAAI,CAACE,MAAM;QACpD,IAAI,CAACG,SAAS,CAACJ,GAAG,CAACQ,EAAE,CAAC,EAAE;UACtBJ,SAAS,CAACF,GAAG,CAACM,EAAE,CAAC;UACjBD,SAAS,CAACE,IAAI,CAACV,IAAI,CAAC;QACtB;MACF;MACAN,KAAK,CAACR,QAAQ,GAAG,CAAC,GAAGQ,KAAK,CAACR,QAAQ,EAAE,GAAGsB,SAAS,CAAC;IACpD,CAAC;IACDG,iBAAiB,EAAEA,CACjBjB,KAAK,EACLC,MAAuE,KACpE;MACHD,KAAK,CAACP,cAAc,GAAGQ,MAAM,CAACG,OAAO;IACvC,CAAC;IACDc,mBAAmB,EAAEA,CAAClB,KAAK,EAAEC,MAAsC,KAAK;MACtE,MAAMkB,aAAa,GAAGnB,KAAK,CAACR,QAAQ,CAAC4B,IAAI,CACtCC,IAAI,IAAK,CAAC/B,SAAS,CAAC+B,IAAI,CAAC,IAAIA,IAAI,CAACb,MAAM,KAAKP,MAAM,CAACG,OAAO,CAACI,MAC/D,CAAC;MACD,IAAI,CAACW,aAAa,EAAE;QAClBnB,KAAK,CAACR,QAAQ,GAAG,CAACS,MAAM,CAACG,OAAO,EAAE,GAAGJ,KAAK,CAACR,QAAQ,CAAC;MACtD;IACF,CAAC;IACD8B,cAAc,EAAEA,CACdtB,KAAK,EACLC,MAAsE,KACnE;MACH,MAAM;QAAEO,MAAM;QAAEe;MAAW,CAAC,GAAGtB,MAAM,CAACG,OAAO;MAC7C,MAAMoB,KAAK,GAAGxB,KAAK,CAACR,QAAQ,CAACiC,SAAS,CACnCJ,IAAI,IAAK,CAAC/B,SAAS,CAAC+B,IAAI,CAAC,IAAIA,IAAI,CAACb,MAAM,KAAKA,MAChD,CAAC;
|
|
1
|
+
{"version":3,"names":["createSlice","isAmityAd","initialState","postList","paginationData","next","previous","globalFeedSlice","name","reducers","setNewGlobalFeed","state","action","seen","Set","payload","filter","post","has","postId","add","updateGlobalFeed","uniqueIds","map","adId","newUnique","id","push","setPaginationData","addPostToGlobalFeed","alreadyExists","some","item","updateByPostId","postDetail","index","findIndex","deleteByPostId","prevPostList","updatedPostList","clearFeed"],"sourceRoot":"../../../../../src","sources":["core/stores/slices/globalfeedSlice.ts"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,kBAAkB;AAC7D,SAASC,SAAS,QAAQ,kDAAkD;AAS5E,MAAMC,YAA6B,GAAG;EACpCC,QAAQ,EAAE,EAAE;EACZC,cAAc,EAAE;IACdC,IAAI,EAAE,IAAI;IACVC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,MAAMC,eAAe,GAAGP,WAAW,CAAC;EAClCQ,IAAI,EAAE,YAAY;EAClBN,YAAY;EACZO,QAAQ,EAAE;IACRC,gBAAgB,EAAEA,CAACC,KAAK,EAAEC,MAAwC,KAAK;MACrE,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;MAC9BH,KAAK,CAACR,QAAQ,GAAGS,MAAM,CAACG,OAAO,CAACC,MAAM,CAAEC,IAAI,IAAK;QAC/C,IAAIJ,IAAI,CAACK,GAAG,CAACD,IAAI,CAACE,MAAM,CAAC,EAAE,OAAO,KAAK;QACvCN,IAAI,CAACO,GAAG,CAACH,IAAI,CAACE,MAAM,CAAC;QACrB,OAAO,IAAI;MACb,CAAC,CAAC;IACJ,CAAC;IACDE,gBAAgB,EAAEA,CAACV,KAAK,EAAEC,MAAwC,KAAK;MACrE,MAAMU,SAAS,GAAG,IAAIR,GAAG,CACvBH,KAAK,CAACR,QAAQ,CAACoB,GAAG,CAAEN,IAAI,IACtBhB,SAAS,CAACgB,IAAI,CAAC,GAAGA,IAAI,CAACO,IAAI,GAAGP,IAAI,CAACE,MACrC,CACF,CAAC;MACD,MAAMM,SAAyC,GAAG,EAAE;MACpD,KAAK,MAAMR,IAAI,IAAIL,MAAM,CAACG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,KAAK,CAACR,QAAQ,CAACgC,KAAK,CAAC,GAAGD,UAAU;IACpC,CAAC;IACDG,cAAc,EAAEA,CAAC1B,KAAK,EAAEC,MAAyC,KAAK;MACpE,MAAM;QAAEO;MAAO,CAAC,GAAGP,MAAM,CAACG,OAAO;MACjC,MAAMuB,YAA4C,GAAG,CAAC,GAAG3B,KAAK,CAACR,QAAQ,CAAC;MACxE,MAAMoC,eAA+C,GACnDD,YAAY,CAACtB,MAAM,CAChBgB,IAAI,IAAK,CAAC/B,SAAS,CAAC+B,IAAI,CAAC,IAAIA,IAAI,CAACb,MAAM,KAAKA,MAChD,CAAC;MAEHR,KAAK,CAACR,QAAQ,GAAGoC,eAAe;IAClC,CAAC;IACDC,SAAS,EAAG7B,KAAK,IAAK;MACpBA,KAAK,CAACR,QAAQ,GAAG,EAAE;IACrB;EACF;AACF,CAAC,CAAC;AAEF,eAAeI,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A video post has no server-side thumbnail until the backend finishes
|
|
5
|
+
* transcoding, so for the first stretch of a new post's life the feed has
|
|
6
|
+
* nothing to render. The composer has already decoded a frame locally to show
|
|
7
|
+
* its own preview, so keep that frame around and let the feed borrow it until
|
|
8
|
+
* the real one exists.
|
|
9
|
+
*
|
|
10
|
+
* Keyed by the ORIGINAL video's fileId, which is what the created post carries
|
|
11
|
+
* in `data.videoFileId.original`. Mirrors web's LayoutProvider `videoThumbnail`
|
|
12
|
+
* + the VideoContent fallback.
|
|
13
|
+
*
|
|
14
|
+
* Only the most recently created post is kept — the same bound web has — so
|
|
15
|
+
* this never grows with session length. These are local file uris, valid only
|
|
16
|
+
* for this process; nothing persists them.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const initialState = {
|
|
20
|
+
postId: null,
|
|
21
|
+
videos: []
|
|
22
|
+
};
|
|
23
|
+
const localVideoThumbnailSlice = createSlice({
|
|
24
|
+
name: 'localVideoThumbnail',
|
|
25
|
+
initialState,
|
|
26
|
+
reducers: {
|
|
27
|
+
setLocalVideoThumbnails: (state, action) => {
|
|
28
|
+
state.postId = action.payload.postId;
|
|
29
|
+
state.videos = action.payload.videos.filter(({
|
|
30
|
+
fileId,
|
|
31
|
+
thumbnailUrl
|
|
32
|
+
}) => !!fileId && !!thumbnailUrl);
|
|
33
|
+
},
|
|
34
|
+
clearLocalVideoThumbnails: state => {
|
|
35
|
+
state.postId = null;
|
|
36
|
+
state.videos = [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export default localVideoThumbnailSlice;
|
|
41
|
+
//# sourceMappingURL=localVideoThumbnailSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSlice","initialState","postId","videos","localVideoThumbnailSlice","name","reducers","setLocalVideoThumbnails","state","action","payload","filter","fileId","thumbnailUrl","clearLocalVideoThumbnails"],"sourceRoot":"../../../../../src","sources":["core/stores/slices/localVideoThumbnailSlice.ts"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,kBAAkB;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMC,YAAsC,GAAG;EAC7CC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,wBAAwB,GAAGJ,WAAW,CAAC;EAC3CK,IAAI,EAAE,qBAAqB;EAC3BJ,YAAY;EACZK,QAAQ,EAAE;IACRC,uBAAuB,EAAEA,CACvBC,KAAK,EACLC,MAGE,KACC;MACHD,KAAK,CAACN,MAAM,GAAGO,MAAM,CAACC,OAAO,CAACR,MAAM;MACpCM,KAAK,CAACL,MAAM,GAAGM,MAAM,CAACC,OAAO,CAACP,MAAM,CAACQ,MAAM,CACzC,CAAC;QAAEC,MAAM;QAAEC;MAAa,CAAC,KAAK,CAAC,CAACD,MAAM,IAAI,CAAC,CAACC,YAC9C,CAAC;IACH,CAAC;IACDC,yBAAyB,EAAGN,KAAK,IAAK;MACpCA,KAAK,CAACN,MAAM,GAAG,IAAI;MACnBM,KAAK,CAACL,MAAM,GAAG,EAAE;IACnB;EACF;AACF,CAAC,CAAC;AAEF,eAAeC,wBAAwB","ignoreList":[]}
|
|
@@ -7,7 +7,8 @@ const initialState = {
|
|
|
7
7
|
targetName: '',
|
|
8
8
|
postSetting: null,
|
|
9
9
|
needApprovalOnPostCreation: true,
|
|
10
|
-
isPublic: false
|
|
10
|
+
isPublic: false,
|
|
11
|
+
feedReloadToken: 0
|
|
11
12
|
};
|
|
12
13
|
const uiSlice = createSlice({
|
|
13
14
|
name: 'ui',
|
|
@@ -39,6 +40,9 @@ const uiSlice = createSlice({
|
|
|
39
40
|
state.isLoadingToast = action.payload.isLoadingToast;
|
|
40
41
|
state.isSuccessToast = action.payload.isSuccessToast;
|
|
41
42
|
},
|
|
43
|
+
markFeedReloaded: state => {
|
|
44
|
+
state.feedReloadToken += 1;
|
|
45
|
+
},
|
|
42
46
|
hideToastMessage: state => {
|
|
43
47
|
state.showToastMessage = false;
|
|
44
48
|
state.toastMessage = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlice","initialState","showPostTypeChoiceModal","userId","targetId","targetType","targetName","postSetting","needApprovalOnPostCreation","isPublic","uiSlice","name","reducers","openPostTypeChoiceModal","state","action","payload","closePostTypeChoiceModal","showToastMessage","toastMessage","isLoadingToast","isSuccessToast","hideToastMessage"],"sourceRoot":"../../../../../src","sources":["core/stores/slices/uiSlice.ts"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,kBAAkB;
|
|
1
|
+
{"version":3,"names":["createSlice","initialState","showPostTypeChoiceModal","userId","targetId","targetType","targetName","postSetting","needApprovalOnPostCreation","isPublic","feedReloadToken","uiSlice","name","reducers","openPostTypeChoiceModal","state","action","payload","closePostTypeChoiceModal","showToastMessage","toastMessage","isLoadingToast","isSuccessToast","markFeedReloaded","hideToastMessage"],"sourceRoot":"../../../../../src","sources":["core/stores/slices/uiSlice.ts"],"mappings":"AAAA,SAAwBA,WAAW,QAAQ,kBAAkB;AA2B7D,MAAMC,YAAqB,GAAG;EAC5BC,uBAAuB,EAAE,KAAK;EAC9BC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,UAAU,EAAE,EAAE;EACdC,UAAU,EAAE,EAAE;EACdC,WAAW,EAAE,IAAI;EACjBC,0BAA0B,EAAE,IAAI;EAChCC,QAAQ,EAAE,KAAK;EACfC,eAAe,EAAE;AACnB,CAAC;AAED,MAAMC,OAAO,GAAGX,WAAW,CAAC;EAC1BY,IAAI,EAAE,IAAI;EACVX,YAAY;EACZY,QAAQ,EAAE;IACRC,uBAAuB,EAAEA,CACvBC,KAAK,EACLC,MAcE,KACC;MACHD,KAAK,CAACb,uBAAuB,GAAG,IAAI;MACpCa,KAAK,CAACZ,MAAM,GAAGa,MAAM,CAACC,OAAO,CAACd,MAAM;MACpCY,KAAK,CAACX,QAAQ,GAAGY,MAAM,CAACC,OAAO,CAACb,QAAQ,IAAI,IAAI;MAChDW,KAAK,CAACT,UAAU,GAAGU,MAAM,CAACC,OAAO,CAACX,UAAU,IAAI,EAAE;MAClDS,KAAK,CAACV,UAAU,GAAGW,MAAM,CAACC,OAAO,CAACZ,UAAU,IAAI,EAAE;MAClDU,KAAK,CAACR,WAAW,GAAGS,MAAM,CAACC,OAAO,CAACV,WAAW,IAAI,IAAI;MACtDQ,KAAK,CAACN,QAAQ,GAAGO,MAAM,CAACC,OAAO,CAACR,QAAQ;MACxCM,KAAK,CAACP,0BAA0B,GAC9BQ,MAAM,CAACC,OAAO,CAACT,0BAA0B;IAC7C,CAAC;IACDU,wBAAwB,EAAGH,KAAK,IAAK;MACnCA,KAAK,CAACb,uBAAuB,GAAG,KAAK;MACrCa,KAAK,CAACZ,MAAM,GAAG,IAAI;MACnBY,KAAK,CAACX,QAAQ,GAAG,IAAI;MACrBW,KAAK,CAACV,UAAU,GAAG,EAAE;MACrBU,KAAK,CAACT,UAAU,GAAG,EAAE;MACrBS,KAAK,CAACR,WAAW,GAAG,IAAI;MACxBQ,KAAK,CAACP,0BAA0B,GAAG,IAAI;MACvCO,KAAK,CAACN,QAAQ,GAAG,KAAK;IACxB,CAAC;IACDU,gBAAgB,EAAEA,CAChBJ,KAAK,EACLC,MAIE,KACC;MACHD,KAAK,CAACI,gBAAgB,GAAG,IAAI;MAC7BJ,KAAK,CAACK,YAAY,GAAGJ,MAAM,CAACC,OAAO,CAACG,YAAY;MAChDL,KAAK,CAACM,cAAc,GAAGL,MAAM,CAACC,OAAO,CAACI,cAAc;MACpDN,KAAK,CAACO,cAAc,GAAGN,MAAM,CAACC,OAAO,CAACK,cAAc;IACtD,CAAC;IACDC,gBAAgB,EAAGR,KAAK,IAAK;MAC3BA,KAAK,CAACL,eAAe,IAAI,CAAC;IAC5B,CAAC;IACDc,gBAAgB,EAAGT,KAAK,IAAK;MAC3BA,KAAK,CAACI,gBAAgB,GAAG,KAAK;MAC9BJ,KAAK,CAACK,YAAY,GAAG,EAAE;MACvBL,KAAK,CAACM,cAAc,GAAG,KAAK;MAC5BN,KAAK,CAACO,cAAc,GAAG,KAAK;IAC9B;EACF;AACF,CAAC,CAAC;AAEF,eAAeX,OAAO","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ import postDetailSlice from '../slices/postDetailSlice';
|
|
|
5
5
|
import uiSlice from '../slices/uiSlice';
|
|
6
6
|
import bottomSheetSlice from '../slices/bottomSheetSlice';
|
|
7
7
|
import toastSlice from '../slices/toastSlice';
|
|
8
|
+
import localVideoThumbnailSlice from '../slices/localVideoThumbnailSlice';
|
|
8
9
|
import { createContext } from 'react';
|
|
9
10
|
import { createStoreHook, createDispatchHook, createSelectorHook } from 'react-redux';
|
|
10
11
|
export const AmityUIKitReduxContext = /*#__PURE__*/createContext(null);
|
|
@@ -18,7 +19,8 @@ export const store = configureStore({
|
|
|
18
19
|
feed: feedSlice.reducer,
|
|
19
20
|
ui: uiSlice.reducer,
|
|
20
21
|
bottomSheet: bottomSheetSlice.reducer,
|
|
21
|
-
toast: toastSlice.reducer
|
|
22
|
+
toast: toastSlice.reducer,
|
|
23
|
+
localVideoThumbnail: localVideoThumbnailSlice.reducer
|
|
22
24
|
},
|
|
23
25
|
middleware: getDefaultMiddleware => getDefaultMiddleware({
|
|
24
26
|
serializableCheck: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configureStore","globalFeedSlice","feedSlice","postDetailSlice","uiSlice","bottomSheetSlice","toastSlice","createContext","createStoreHook","createDispatchHook","createSelectorHook","AmityUIKitReduxContext","useUIKitStore","useUIKitDispatch","useUIKitSelector","store","reducer","globalFeed","postDetail","feed","ui","bottomSheet","toast","middleware","getDefaultMiddleware","serializableCheck"],"sourceRoot":"../../../../../src","sources":["core/stores/store/index.ts"],"mappings":"AAAA,SAASA,cAAc,QAAe,kBAAkB;AACxD,OAAOC,eAAe,MAAM,2BAA2B;AACvD,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,eAAe,MAAM,2BAA2B;AACvD,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,UAAU,MAAM,sBAAsB;AAC7C,SAASC,aAAa,QAAQ,OAAO;AACrC,SACEC,eAAe,EACfC,kBAAkB,EAClBC,kBAAkB,QAEb,aAAa;AAGpB,OAAO,MAAMC,sBAAsB,gBAAGJ,aAAa,CAEjD,IAAW,CAAC;AAEd,OAAO,MAAMK,aAAa,GAAGJ,eAAe,CAACG,sBAA6B,CAAC;AAC3E,OAAO,MAAME,gBAAgB,GAAGJ,kBAAkB,CAChDE,sBACF,CAAC;AACD,OAAO,MAAMG,gBAAgB,GAAGJ,kBAAkB,CAChDC,sBACF,CAAC;AAED,OAAO,MAAMI,KAAY,
|
|
1
|
+
{"version":3,"names":["configureStore","globalFeedSlice","feedSlice","postDetailSlice","uiSlice","bottomSheetSlice","toastSlice","localVideoThumbnailSlice","createContext","createStoreHook","createDispatchHook","createSelectorHook","AmityUIKitReduxContext","useUIKitStore","useUIKitDispatch","useUIKitSelector","store","reducer","globalFeed","postDetail","feed","ui","bottomSheet","toast","localVideoThumbnail","middleware","getDefaultMiddleware","serializableCheck"],"sourceRoot":"../../../../../src","sources":["core/stores/store/index.ts"],"mappings":"AAAA,SAASA,cAAc,QAAe,kBAAkB;AACxD,OAAOC,eAAe,MAAM,2BAA2B;AACvD,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,eAAe,MAAM,2BAA2B;AACvD,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,UAAU,MAAM,sBAAsB;AAC7C,OAAOC,wBAAwB,MAAM,oCAAoC;AACzE,SAASC,aAAa,QAAQ,OAAO;AACrC,SACEC,eAAe,EACfC,kBAAkB,EAClBC,kBAAkB,QAEb,aAAa;AAGpB,OAAO,MAAMC,sBAAsB,gBAAGJ,aAAa,CAEjD,IAAW,CAAC;AAEd,OAAO,MAAMK,aAAa,GAAGJ,eAAe,CAACG,sBAA6B,CAAC;AAC3E,OAAO,MAAME,gBAAgB,GAAGJ,kBAAkB,CAChDE,sBACF,CAAC;AACD,OAAO,MAAMG,gBAAgB,GAAGJ,kBAAkB,CAChDC,sBACF,CAAC;AAED,OAAO,MAAMI,KAAY,GAAGhB,cAAc,CAAC;EACzCiB,OAAO,EAAE;IACPC,UAAU,EAAEjB,eAAe,CAACgB,OAAO;IACnCE,UAAU,EAAEhB,eAAe,CAACc,OAAO;IACnCG,IAAI,EAAElB,SAAS,CAACe,OAAO;IACvBI,EAAE,EAAEjB,OAAO,CAACa,OAAO;IACnBK,WAAW,EAAEjB,gBAAgB,CAACY,OAAO;IACrCM,KAAK,EAAEjB,UAAU,CAACW,OAAO;IACzBO,mBAAmB,EAAEjB,wBAAwB,CAACU;EAChD,CAAC;EACDQ,UAAU,EAAGC,oBAAoB,IAC/BA,oBAAoB,CAAC;IACnBC,iBAAiB,EAAE;EACrB,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import NetInfo from '@react-native-community/netinfo';
|
|
2
3
|
import { View, Image, TouchableOpacity } from 'react-native';
|
|
3
4
|
import * as Progress from 'react-native-progress';
|
|
4
5
|
import { SvgXml } from 'react-native-svg';
|
|
5
6
|
import { deleteAmityFile, uploadImageFile } from '../../../core/legacy/file';
|
|
6
|
-
import {
|
|
7
|
+
import { mediaRemoveIcon, toastIcon } from '../../../core/assets/icons/xml';
|
|
7
8
|
import { useStyles } from './styles';
|
|
8
9
|
const LoadingImage = ({
|
|
9
10
|
source,
|
|
@@ -12,11 +13,12 @@ const LoadingImage = ({
|
|
|
12
13
|
onLoadFinish,
|
|
13
14
|
onUploadError,
|
|
14
15
|
isUploaded = false,
|
|
16
|
+
displayUri,
|
|
15
17
|
fileId = '',
|
|
16
18
|
isEditMode = false,
|
|
17
19
|
fileCount,
|
|
18
20
|
postId,
|
|
19
|
-
|
|
21
|
+
onUploadingChange,
|
|
20
22
|
carousel = false
|
|
21
23
|
}) => {
|
|
22
24
|
const [loading, setLoading] = useState(true);
|
|
@@ -26,16 +28,33 @@ const LoadingImage = ({
|
|
|
26
28
|
const styles = useStyles();
|
|
27
29
|
const handleLoadEnd = useCallback(() => {
|
|
28
30
|
setLoading(false);
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(false, source);
|
|
32
|
+
}, [onUploadingChange, source]);
|
|
31
33
|
useEffect(() => {
|
|
32
34
|
if (progress === 100) {
|
|
33
35
|
setIsProcess(true);
|
|
34
36
|
}
|
|
35
37
|
}, [progress]);
|
|
36
38
|
const uploadFileToAmity = useCallback(async () => {
|
|
37
|
-
|
|
39
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(true, source);
|
|
38
40
|
setIsUploadError(false);
|
|
41
|
+
// A retry re-enters this function with `loading` already false — the failed
|
|
42
|
+
// attempt's `handleLoadEnd` cleared it and nothing ever set it back, so
|
|
43
|
+
// `setLoading` only ever ran downwards in this component. The frame then
|
|
44
|
+
// re-uploaded with no spinner at all, which reads as "finished instantly"
|
|
45
|
+
// while Post stays disabled for the length of the upload.
|
|
46
|
+
// Progress and the processing flag are stale from the failed attempt too,
|
|
47
|
+
// so reset the whole visual upload state here rather than only in the
|
|
48
|
+
// mount effect, which does not re-run on a retry.
|
|
49
|
+
setLoading(true);
|
|
50
|
+
setProgress(0);
|
|
51
|
+
setIsProcess(false);
|
|
52
|
+
// Clearing the local flag alone left this source inside the parent's
|
|
53
|
+
// `imageErrors` set, and that set is otherwise only cleared by the
|
|
54
|
+
// mount effect below — which does not re-run on a retry, since neither
|
|
55
|
+
// `isUploaded` nor `source` changed. Post stayed disabled even after the
|
|
56
|
+
// retry uploaded fine, so tell the parent the error is gone up front.
|
|
57
|
+
onUploadError === null || onUploadError === void 0 || onUploadError(false, source);
|
|
39
58
|
try {
|
|
40
59
|
const file = await uploadImageFile(source, percent => {
|
|
41
60
|
setProgress(percent);
|
|
@@ -46,7 +65,8 @@ const LoadingImage = ({
|
|
|
46
65
|
handleLoadEnd();
|
|
47
66
|
onLoadFinish && onLoadFinish((_file$ = file[0]) === null || _file$ === void 0 ? void 0 : _file$.fileId, ((_file$2 = file[0]) === null || _file$2 === void 0 ? void 0 : _file$2.fileUrl) + '?size=medium', (_file$3 = file[0]) === null || _file$3 === void 0 ? void 0 : _file$3.attributes.name, index, source);
|
|
48
67
|
} else {
|
|
49
|
-
|
|
68
|
+
// `handleLoadEnd` already reports the upload as finished — the extra
|
|
69
|
+
// setter call it used to be paired with was redundant.
|
|
50
70
|
handleLoadEnd();
|
|
51
71
|
setIsProcess(false);
|
|
52
72
|
setIsUploadError(true);
|
|
@@ -55,11 +75,34 @@ const LoadingImage = ({
|
|
|
55
75
|
} catch (error) {
|
|
56
76
|
handleLoadEnd();
|
|
57
77
|
setIsProcess(false);
|
|
58
|
-
setIsUploading(false);
|
|
59
78
|
setIsUploadError(true);
|
|
60
79
|
onUploadError === null || onUploadError === void 0 || onUploadError(true, source);
|
|
61
80
|
}
|
|
62
|
-
}, [handleLoadEnd, index, onLoadFinish, onUploadError,
|
|
81
|
+
}, [handleLoadEnd, index, onLoadFinish, onUploadError, onUploadingChange, source]);
|
|
82
|
+
|
|
83
|
+
// The frame is expected to end up uploaded, and Post enabled, once
|
|
84
|
+
// connectivity returns. Nothing retried on its own —
|
|
85
|
+
// the error key only cleared on a manual tap on that specific frame, and the
|
|
86
|
+
// peek carousel can leave a failed frame off-screen entirely, so Post stayed
|
|
87
|
+
// disabled with no visible cause. Retry when the device regains a
|
|
88
|
+
// connection, using the same NetInfo listener idiom as post Detail and the
|
|
89
|
+
// livestream screens.
|
|
90
|
+
//
|
|
91
|
+
// Gated on a disconnected -> connected transition, not merely on being
|
|
92
|
+
// connected: addEventListener fires immediately with the current state, so a
|
|
93
|
+
// failure that happened while online (a server error, say) would otherwise
|
|
94
|
+
// re-fire on every resubscribe and spin.
|
|
95
|
+
const wasDisconnectedRef = useRef(false);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const unsubscribe = NetInfo.addEventListener(state => {
|
|
98
|
+
const isConnected = !!state.isConnected;
|
|
99
|
+
if (isConnected && wasDisconnectedRef.current && isUploadError) {
|
|
100
|
+
uploadFileToAmity();
|
|
101
|
+
}
|
|
102
|
+
wasDisconnectedRef.current = !isConnected;
|
|
103
|
+
});
|
|
104
|
+
return () => unsubscribe();
|
|
105
|
+
}, [isUploadError, uploadFileToAmity]);
|
|
63
106
|
const handleDelete = async () => {
|
|
64
107
|
if (fileId && !isEditMode) {
|
|
65
108
|
await deleteAmityFile(fileId);
|
|
@@ -77,6 +120,17 @@ const LoadingImage = ({
|
|
|
77
120
|
uploadFileToAmity();
|
|
78
121
|
}
|
|
79
122
|
}, [isUploaded, source]);
|
|
123
|
+
|
|
124
|
+
// A frame can be removed (or its source swapped) while its upload is still
|
|
125
|
+
// in flight, in which case `handleLoadEnd` never runs and the composer would
|
|
126
|
+
// keep waiting on an entry no mounted child owns any more — leaving Post
|
|
127
|
+
// disabled forever. Clearing it from this cleanup keeps the
|
|
128
|
+
// bookkeeping in the same component that added it.
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
return () => {
|
|
131
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(false, source);
|
|
132
|
+
};
|
|
133
|
+
}, [onUploadingChange, source]);
|
|
80
134
|
const onRetryUpload = () => {
|
|
81
135
|
uploadFileToAmity();
|
|
82
136
|
};
|
|
@@ -84,7 +138,7 @@ const LoadingImage = ({
|
|
|
84
138
|
style: carousel ? styles.carouselContainer : fileCount >= 3 ? styles.image3XContainer : styles.container
|
|
85
139
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
86
140
|
source: {
|
|
87
|
-
uri: source
|
|
141
|
+
uri: displayUri ?? source
|
|
88
142
|
},
|
|
89
143
|
resizeMode: carousel ? 'cover' : 'contain',
|
|
90
144
|
style: [styles.image, loading ? styles.loadingImage : styles.loadedImage]
|
|
@@ -110,13 +164,19 @@ const LoadingImage = ({
|
|
|
110
164
|
width: "28",
|
|
111
165
|
height: "28"
|
|
112
166
|
}))), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
113
|
-
style: styles.closeButton
|
|
167
|
+
style: styles.closeButton
|
|
168
|
+
// The button matches web at 28dp, which is still under Apple's 44pt
|
|
169
|
+
// minimum touch target. Grow the touch area rather than the black
|
|
170
|
+
// disc, so the visual stays in parity while the frame stays tappable:
|
|
171
|
+
// 28 + 8 on each side lands exactly on 44.
|
|
172
|
+
,
|
|
173
|
+
hitSlop: 8,
|
|
114
174
|
disabled: (loading || isProcess) && !isUploadError,
|
|
115
175
|
onPress: handleDelete
|
|
116
176
|
}, /*#__PURE__*/React.createElement(SvgXml, {
|
|
117
|
-
xml:
|
|
118
|
-
width: "
|
|
119
|
-
height: "
|
|
177
|
+
xml: mediaRemoveIcon(),
|
|
178
|
+
width: "20",
|
|
179
|
+
height: "20"
|
|
120
180
|
})));
|
|
121
181
|
};
|
|
122
182
|
export default LoadingImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useEffect","useState","View","Image","TouchableOpacity","Progress","SvgXml","deleteAmityFile","uploadImageFile","
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useRef","useState","NetInfo","View","Image","TouchableOpacity","Progress","SvgXml","deleteAmityFile","uploadImageFile","mediaRemoveIcon","toastIcon","useStyles","LoadingImage","source","onClose","index","onLoadFinish","onUploadError","isUploaded","displayUri","fileId","isEditMode","fileCount","postId","onUploadingChange","carousel","loading","setLoading","progress","setProgress","isProcess","setIsProcess","isUploadError","setIsUploadError","styles","handleLoadEnd","uploadFileToAmity","file","percent","_file$","_file$2","_file$3","fileUrl","attributes","name","error","wasDisconnectedRef","unsubscribe","addEventListener","state","isConnected","current","handleDelete","onRetryUpload","React","createElement","style","carouselContainer","image3XContainer","container","uri","resizeMode","image","loadingImage","loadedImage","overlay","CircleSnail","size","borderColor","thickness","Circle","unfilledColor","failedOverlay","errorOverlay","onPress","xml","width","height","closeButton","hitSlop","disabled"],"sourceRoot":"../../../../../src","sources":["social/components/LoadingImage/index.tsx"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChE,OAAOC,OAAO,MAAM,iCAAiC;AACrD,SAASC,IAAI,EAAEC,KAAK,EAAEC,gBAAgB,QAAQ,cAAc;AAC5D,OAAO,KAAKC,QAAQ,MAAM,uBAAuB;AACjD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,SAASC,eAA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,IAAIM,aAAa,iBACxBsB,KAAA,CAAAC,aAAA,CAACrD,IAAI;IAACsD,KAAK,EAAEtB,MAAM,CAACsC;EAAc,gBAChClB,KAAA,CAAAC,aAAA,CAACnD,gBAAgB;IAACoD,KAAK,EAAEtB,MAAM,CAACuC,YAAa;IAACC,OAAO,EAAErB;EAAc,gBACnEC,KAAA,CAAAC,aAAA,CAACjD,MAAM;IAACqE,GAAG,EAAEjE,SAAS,CAAC,CAAE;IAACkE,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC;EAAI,CAAE,CAClC,CACd,CACP,eAEDvB,KAAA,CAAAC,aAAA,CAACnD,gBAAgB;IACfoD,KAAK,EAAEtB,MAAM,CAAC4C;IACd;IACA;IACA;IACA;IAAA;IACAC,OAAO,EAAE,CAAE;IACXC,QAAQ,EAAE,CAACtD,OAAO,IAAII,SAAS,KAAK,CAACE,aAAc;IACnD0C,OAAO,EAAEtB;EAAa,gBAEtBE,KAAA,CAAAC,aAAA,CAACjD,MAAM;IAACqE,GAAG,EAAElE,eAAe,CAAC,CAAE;IAACmE,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC;EAAI,CAAE,CACxC,CACd,CAAC;AAEX,CAAC;AACD,eAAejE,YAAY","ignoreList":[]}
|
|
@@ -56,9 +56,14 @@ export const useStyles = () => {
|
|
|
56
56
|
},
|
|
57
57
|
closeButton: {
|
|
58
58
|
position: 'absolute',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
// Matched to the web UIKit's remove button, which is 20px of icon inside
|
|
60
|
+
// 4px of padding at an 8px offset. The old 12/7 pair came to nearly the
|
|
61
|
+
// same 26dp outer size but filled only 46% of the circle with the glyph
|
|
62
|
+
// against web's 71%, so it read as a heavy black disc with a tiny cross
|
|
63
|
+
// in it.
|
|
64
|
+
top: 8,
|
|
65
|
+
right: 8,
|
|
66
|
+
padding: 4,
|
|
62
67
|
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
63
68
|
borderRadius: 72,
|
|
64
69
|
zIndex: 10
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useWindowDimensions","StyleSheet","useStyles","width","create","container","flex","height","margin","image3XContainer","carouselContainer","image","resizeMode","borderRadius","position","overlay","absoluteFillObject","justifyContent","alignItems","failedOverlay","backgroundColor","errorOverlay","top","left","right","progressBar","marginVertical","loadingImage","opacity","loadedImage","closeButton","padding","zIndex"],"sourceRoot":"../../../../../src","sources":["social/components/LoadingImage/styles.ts"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,UAAU,QAAQ,cAAc;AAE9D,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,MAAM;IAAEC;EAAM,CAAC,GAAGH,mBAAmB,CAAC,CAAC;EACvC,OAAOC,UAAU,CAACG,MAAM,CAAC;IACvBC,SAAS,EAAE;MACTC,IAAI,EAAE,CAAC;MACPC,MAAM,EAAEJ,KAAK,GAAG,EAAE;MAClBK,MAAM,EAAE;IACV,CAAC;IACDC,gBAAgB,EAAE;MAChBN,KAAK,EAAEA,KAAK,GAAG,CAAC,GAAG,EAAE;MACrBI,MAAM,EAAEJ,KAAK,GAAG,CAAC,GAAG,EAAE;MACtBK,MAAM,EAAE;IACV,CAAC;IACDE,iBAAiB,EAAE;MACjBP,KAAK,EAAE,MAAM;MACbI,MAAM,EAAE;IACV,CAAC;IACDI,KAAK,EAAE;MACLR,KAAK,EAAE,MAAM;MACbI,MAAM,EAAE,MAAM;MACdK,UAAU,EAAE,OAAO;MACnBC,YAAY,EAAE,CAAC;MACfC,QAAQ,EAAE;IACZ,CAAC;IACDC,OAAO,EAAE;MACP,GAAGd,UAAU,CAACe,kBAAkB;MAChCC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACd,CAAC;IACDC,aAAa,EAAE;MACb,GAAGlB,UAAU,CAACe,kBAAkB;MAChCC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBE,eAAe,EAAE,oBAAoB;MACrCP,YAAY,EAAE;IAChB,CAAC;IACDQ,YAAY,EAAE;MACZP,QAAQ,EAAE,UAAU;MACpBQ,GAAG,EAAE,KAAK;MACVC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRN,UAAU,EAAE,QAAQ;MACpBD,cAAc,EAAE;IAClB,CAAC;IACDQ,WAAW,EAAE;MACXC,cAAc,EAAE;IAClB,CAAC;IACDC,YAAY,EAAE;MACZC,OAAO,EAAE;IACX,CAAC;IACDC,WAAW,EAAE;MACXD,OAAO,EAAE;IACX,CAAC;IACDE,WAAW,EAAE;MACXhB,QAAQ,EAAE,UAAU;
|
|
1
|
+
{"version":3,"names":["useWindowDimensions","StyleSheet","useStyles","width","create","container","flex","height","margin","image3XContainer","carouselContainer","image","resizeMode","borderRadius","position","overlay","absoluteFillObject","justifyContent","alignItems","failedOverlay","backgroundColor","errorOverlay","top","left","right","progressBar","marginVertical","loadingImage","opacity","loadedImage","closeButton","padding","zIndex"],"sourceRoot":"../../../../../src","sources":["social/components/LoadingImage/styles.ts"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,UAAU,QAAQ,cAAc;AAE9D,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,MAAM;IAAEC;EAAM,CAAC,GAAGH,mBAAmB,CAAC,CAAC;EACvC,OAAOC,UAAU,CAACG,MAAM,CAAC;IACvBC,SAAS,EAAE;MACTC,IAAI,EAAE,CAAC;MACPC,MAAM,EAAEJ,KAAK,GAAG,EAAE;MAClBK,MAAM,EAAE;IACV,CAAC;IACDC,gBAAgB,EAAE;MAChBN,KAAK,EAAEA,KAAK,GAAG,CAAC,GAAG,EAAE;MACrBI,MAAM,EAAEJ,KAAK,GAAG,CAAC,GAAG,EAAE;MACtBK,MAAM,EAAE;IACV,CAAC;IACDE,iBAAiB,EAAE;MACjBP,KAAK,EAAE,MAAM;MACbI,MAAM,EAAE;IACV,CAAC;IACDI,KAAK,EAAE;MACLR,KAAK,EAAE,MAAM;MACbI,MAAM,EAAE,MAAM;MACdK,UAAU,EAAE,OAAO;MACnBC,YAAY,EAAE,CAAC;MACfC,QAAQ,EAAE;IACZ,CAAC;IACDC,OAAO,EAAE;MACP,GAAGd,UAAU,CAACe,kBAAkB;MAChCC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACd,CAAC;IACDC,aAAa,EAAE;MACb,GAAGlB,UAAU,CAACe,kBAAkB;MAChCC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBE,eAAe,EAAE,oBAAoB;MACrCP,YAAY,EAAE;IAChB,CAAC;IACDQ,YAAY,EAAE;MACZP,QAAQ,EAAE,UAAU;MACpBQ,GAAG,EAAE,KAAK;MACVC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRN,UAAU,EAAE,QAAQ;MACpBD,cAAc,EAAE;IAClB,CAAC;IACDQ,WAAW,EAAE;MACXC,cAAc,EAAE;IAClB,CAAC;IACDC,YAAY,EAAE;MACZC,OAAO,EAAE;IACX,CAAC;IACDC,WAAW,EAAE;MACXD,OAAO,EAAE;IACX,CAAC;IACDE,WAAW,EAAE;MACXhB,QAAQ,EAAE,UAAU;MACpB;MACA;MACA;MACA;MACA;MACAQ,GAAG,EAAE,CAAC;MACNE,KAAK,EAAE,CAAC;MACRO,OAAO,EAAE,CAAC;MACVX,eAAe,EAAE,oBAAoB;MACrCP,YAAY,EAAE,EAAE;MAChBmB,MAAM,EAAE;IACV;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import NetInfo from '@react-native-community/netinfo';
|
|
2
3
|
import { View, TouchableOpacity, Platform, Image } from 'react-native';
|
|
3
4
|
import * as Progress from 'react-native-progress';
|
|
4
5
|
import { SvgXml } from 'react-native-svg';
|
|
5
6
|
import { deleteAmityFile, uploadVideoFile } from '../../../core/legacy/file';
|
|
6
|
-
import {
|
|
7
|
+
import { mediaRemoveIcon, playBtn, toastIcon, videoControlIcon } from '../../../core/assets/icons/xml';
|
|
7
8
|
import { useStyles } from './styles';
|
|
8
9
|
import Video from 'react-native-video';
|
|
9
10
|
import { useNavigation } from '@react-navigation/native';
|
|
@@ -17,13 +18,14 @@ const LoadingVideo = ({
|
|
|
17
18
|
onLoadFinish,
|
|
18
19
|
onUploadError,
|
|
19
20
|
isUploaded = false,
|
|
21
|
+
displayUri,
|
|
20
22
|
thumbNail,
|
|
21
23
|
onPlay,
|
|
22
24
|
fileId,
|
|
23
25
|
isEditMode = false,
|
|
24
26
|
fileCount,
|
|
25
27
|
postId,
|
|
26
|
-
|
|
28
|
+
onUploadingChange,
|
|
27
29
|
carousel = false
|
|
28
30
|
}) => {
|
|
29
31
|
const dispatch = useUIKitDispatch();
|
|
@@ -35,6 +37,10 @@ const LoadingVideo = ({
|
|
|
35
37
|
const [isProcess, setIsProcess] = useState(false);
|
|
36
38
|
const [isUploadError, setIsUploadError] = useState(false);
|
|
37
39
|
const [thumbNailImage, setThumbNailImage] = useState(thumbNail ?? '');
|
|
40
|
+
// `uploadFileToAmity` is memoised on [source] only, so reading the state
|
|
41
|
+
// there would capture the empty first-render value. Mirror it into a ref so
|
|
42
|
+
// the upload callback always sees the frame that was actually decoded.
|
|
43
|
+
const thumbNailImageRef = useRef(thumbNail ?? '');
|
|
38
44
|
const styles = useStyles();
|
|
39
45
|
const [playingUri, setPlayingUri] = useState('');
|
|
40
46
|
const [isPause, setIsPause] = useState(true);
|
|
@@ -55,10 +61,11 @@ const LoadingVideo = ({
|
|
|
55
61
|
};
|
|
56
62
|
const handleLoadEnd = () => {
|
|
57
63
|
setLoading(false);
|
|
58
|
-
|
|
64
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(false, source);
|
|
59
65
|
};
|
|
60
66
|
const processThumbNail = async () => {
|
|
61
|
-
const generatedThumbNail = await createVideoThumbnail(source);
|
|
67
|
+
const generatedThumbNail = await createVideoThumbnail(displayUri ?? source);
|
|
68
|
+
thumbNailImageRef.current = generatedThumbNail.path;
|
|
62
69
|
setThumbNailImage(generatedThumbNail.path);
|
|
63
70
|
};
|
|
64
71
|
useEffect(() => {
|
|
@@ -70,8 +77,25 @@ const LoadingVideo = ({
|
|
|
70
77
|
}
|
|
71
78
|
}, [progress]);
|
|
72
79
|
const uploadFileToAmity = useCallback(async () => {
|
|
73
|
-
|
|
80
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(true, source);
|
|
74
81
|
setIsUploadError(false);
|
|
82
|
+
// A retry re-enters this function with `loading` already false — the failed
|
|
83
|
+
// attempt's `handleLoadEnd` cleared it and nothing ever set it back, so
|
|
84
|
+
// `setLoading` only ever ran downwards in this component. The frame then
|
|
85
|
+
// re-uploaded with no spinner at all, which reads as "finished instantly"
|
|
86
|
+
// while Post stays disabled for the length of the upload.
|
|
87
|
+
// Progress and the processing flag are stale from the failed attempt too,
|
|
88
|
+
// so reset the whole visual upload state here rather than only in the
|
|
89
|
+
// mount effect, which does not re-run on a retry.
|
|
90
|
+
setLoading(true);
|
|
91
|
+
setProgress(0);
|
|
92
|
+
setIsProcess(false);
|
|
93
|
+
// Clearing the local flag alone left this source inside the parent's
|
|
94
|
+
// `videoErrors` set, and that set is otherwise only cleared by the
|
|
95
|
+
// mount effect below — which does not re-run on a retry, since none of
|
|
96
|
+
// `fileId`/`isUploaded`/`source` changed. Post stayed disabled even after
|
|
97
|
+
// the retry uploaded fine, so tell the parent the error is gone up front.
|
|
98
|
+
onUploadError === null || onUploadError === void 0 || onUploadError(false, source);
|
|
75
99
|
try {
|
|
76
100
|
const file = await uploadVideoFile(source, percent => {
|
|
77
101
|
setProgress(percent);
|
|
@@ -80,7 +104,13 @@ const LoadingVideo = ({
|
|
|
80
104
|
var _file$, _file$2, _file$3;
|
|
81
105
|
setIsProcess(false);
|
|
82
106
|
handleLoadEnd();
|
|
83
|
-
onLoadFinish && onLoadFinish((_file$ = file[0]) === null || _file$ === void 0 ? void 0 : _file$.fileId, (_file$2 = file[0]) === null || _file$2 === void 0 ? void 0 : _file$2.fileUrl, (_file$3 = file[0]) === null || _file$3 === void 0 ? void 0 : _file$3.attributes.name, index, source,
|
|
107
|
+
onLoadFinish && onLoadFinish((_file$ = file[0]) === null || _file$ === void 0 ? void 0 : _file$.fileId, (_file$2 = file[0]) === null || _file$2 === void 0 ? void 0 : _file$2.fileUrl, (_file$3 = file[0]) === null || _file$3 === void 0 ? void 0 : _file$3.attributes.name, index, source,
|
|
108
|
+
// Hand back the frame this component decoded, not the incoming
|
|
109
|
+
// prop — for a newly picked video that prop is empty, so the
|
|
110
|
+
// generated thumbnail used to be dropped on the floor. The
|
|
111
|
+
// composer stores it so the feed can show it while the server is
|
|
112
|
+
// still transcoding (PDT-4904).
|
|
113
|
+
thumbNailImageRef.current || thumbNail);
|
|
84
114
|
} else {
|
|
85
115
|
handleLoadEnd();
|
|
86
116
|
dispatch(showToastMessage({
|
|
@@ -100,6 +130,30 @@ const LoadingVideo = ({
|
|
|
100
130
|
onUploadError === null || onUploadError === void 0 || onUploadError(true, source);
|
|
101
131
|
}
|
|
102
132
|
}, [source]);
|
|
133
|
+
|
|
134
|
+
// The frame is expected to end up uploaded, and Post enabled, once
|
|
135
|
+
// connectivity returns. Nothing retried on its own —
|
|
136
|
+
// the error key only cleared on a manual tap on that specific frame, and the
|
|
137
|
+
// peek carousel can leave a failed frame off-screen entirely, so Post stayed
|
|
138
|
+
// disabled with no visible cause. Retry when the device regains a
|
|
139
|
+
// connection, using the same NetInfo listener idiom as post Detail and the
|
|
140
|
+
// livestream screens.
|
|
141
|
+
//
|
|
142
|
+
// Gated on a disconnected -> connected transition, not merely on being
|
|
143
|
+
// connected: addEventListener fires immediately with the current state, so a
|
|
144
|
+
// failure that happened while online (a server error, say) would otherwise
|
|
145
|
+
// re-fire on every resubscribe and spin.
|
|
146
|
+
const wasDisconnectedRef = useRef(false);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
const unsubscribe = NetInfo.addEventListener(state => {
|
|
149
|
+
const isConnected = !!state.isConnected;
|
|
150
|
+
if (isConnected && wasDisconnectedRef.current && isUploadError) {
|
|
151
|
+
uploadFileToAmity();
|
|
152
|
+
}
|
|
153
|
+
wasDisconnectedRef.current = !isConnected;
|
|
154
|
+
});
|
|
155
|
+
return () => unsubscribe();
|
|
156
|
+
}, [isUploadError, uploadFileToAmity]);
|
|
103
157
|
const handleDelete = async () => {
|
|
104
158
|
if (fileId && !isEditMode) {
|
|
105
159
|
await deleteAmityFile(fileId);
|
|
@@ -118,15 +172,29 @@ const LoadingVideo = ({
|
|
|
118
172
|
}
|
|
119
173
|
}, [fileId, isUploaded, source]);
|
|
120
174
|
const handleOnPlay = () => {
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
//
|
|
175
|
+
// In carousel mode the parent (onPlay) owns the full-screen media viewer,
|
|
176
|
+
// so this component never mounts the inline <Video> and never receives a
|
|
177
|
+
// dismiss callback to unpause with. Leaving `isPause` alone keeps the play
|
|
178
|
+
// icon rendered, which is what the frame shows once the viewer closes
|
|
179
|
+
// (PDT-4904); toggling it here hid the icon for the rest of the session.
|
|
124
180
|
if (onPlay) {
|
|
125
181
|
onPlay(source);
|
|
126
182
|
return;
|
|
127
183
|
}
|
|
184
|
+
setIsPause(!isPause);
|
|
128
185
|
playVideoFullScreen(source);
|
|
129
186
|
};
|
|
187
|
+
|
|
188
|
+
// A frame can be removed (or its source swapped) while its upload is still
|
|
189
|
+
// in flight, in which case `handleLoadEnd` never runs and the composer would
|
|
190
|
+
// keep waiting on an entry no mounted child owns any more — leaving Post
|
|
191
|
+
// disabled forever. Clearing it from this cleanup keeps the
|
|
192
|
+
// bookkeeping in the same component that added it.
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
return () => {
|
|
195
|
+
onUploadingChange === null || onUploadingChange === void 0 || onUploadingChange(false, source);
|
|
196
|
+
};
|
|
197
|
+
}, [onUploadingChange, source]);
|
|
130
198
|
const onRetryUpload = () => {
|
|
131
199
|
uploadFileToAmity();
|
|
132
200
|
};
|
|
@@ -155,7 +223,7 @@ const LoadingVideo = ({
|
|
|
155
223
|
style: [styles.image, loading ? styles.loadingImage : styles.loadedImage]
|
|
156
224
|
}) : /*#__PURE__*/React.createElement(View, {
|
|
157
225
|
style: styles.image
|
|
158
|
-
}), loading
|
|
226
|
+
}), loading && /*#__PURE__*/React.createElement(View, {
|
|
159
227
|
style: styles.overlay
|
|
160
228
|
}, isProcess ? /*#__PURE__*/React.createElement(Progress.CircleSnail, {
|
|
161
229
|
size: 24,
|
|
@@ -167,21 +235,27 @@ const LoadingVideo = ({
|
|
|
167
235
|
borderColor: "transparent",
|
|
168
236
|
unfilledColor: "#ffffff",
|
|
169
237
|
thickness: 2
|
|
170
|
-
}))
|
|
238
|
+
})), !loading && isUploadError && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
171
239
|
style: styles.overlay,
|
|
172
240
|
onPress: onRetryUpload
|
|
173
241
|
}, /*#__PURE__*/React.createElement(SvgXml, {
|
|
174
242
|
xml: toastIcon(),
|
|
175
243
|
width: "24",
|
|
176
244
|
height: "24"
|
|
177
|
-
}))
|
|
178
|
-
style: styles.closeButton
|
|
245
|
+
})), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
246
|
+
style: styles.closeButton
|
|
247
|
+
// The button matches web at 28dp, which is still under Apple's 44pt
|
|
248
|
+
// minimum touch target. Grow the touch area rather than the black
|
|
249
|
+
// disc, so the visual stays in parity while the frame stays tappable:
|
|
250
|
+
// 28 + 8 on each side lands exactly on 44.
|
|
251
|
+
,
|
|
252
|
+
hitSlop: 8,
|
|
179
253
|
disabled: (loading || isProcess) && !isUploadError,
|
|
180
254
|
onPress: handleDelete
|
|
181
255
|
}, /*#__PURE__*/React.createElement(SvgXml, {
|
|
182
|
-
xml:
|
|
183
|
-
width: "
|
|
184
|
-
height: "
|
|
256
|
+
xml: mediaRemoveIcon(),
|
|
257
|
+
width: "20",
|
|
258
|
+
height: "20"
|
|
185
259
|
})));
|
|
186
260
|
};
|
|
187
261
|
export default LoadingVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useEffect","useState","View","TouchableOpacity","Platform","Image","Progress","SvgXml","deleteAmityFile","uploadVideoFile","
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useRef","useState","NetInfo","View","TouchableOpacity","Platform","Image","Progress","SvgXml","deleteAmityFile","uploadVideoFile","mediaRemoveIcon","playBtn","toastIcon","videoControlIcon","useStyles","Video","useNavigation","uiSlice","createVideoThumbnail","useUIKitDispatch","LoadingVideo","source","onClose","index","onLoadFinish","onUploadError","isUploaded","displayUri","thumbNail","onPlay","fileId","isEditMode","fileCount","postId","onUploadingChange","carousel","dispatch","showToastMessage","actions","loading","setLoading","progress","setProgress","isProcess","setIsProcess","isUploadError","setIsUploadError","thumbNailImage","setThumbNailImage","thumbNailImageRef","styles","playingUri","setPlayingUri","isPause","setIsPause","navigation","playVideoFullScreen","fileUrl","OS","navigate","onClosePlayer","handleLoadEnd","processThumbNail","generatedThumbNail","current","path","uploadFileToAmity","file","percent","_file$","_file$2","_file$3","attributes","name","toastMessage","error","wasDisconnectedRef","unsubscribe","addEventListener","state","isConnected","handleDelete","handleOnPlay","onRetryUpload","React","createElement","style","carouselContainer","image3XContainer","container","playButton","onPress","xml","width","height","controls","image","uri","onFullscreenPlayerWillDismiss","paused","resizeMode","loadingImage","loadedImage","overlay","CircleSnail","size","borderColor","thickness","Circle","unfilledColor","closeButton","hitSlop","disabled"],"sourceRoot":"../../../../../src","sources":["social/components/LoadingVideo/index.tsx"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChE,OAAOC,OAAO,MAAM,iCAAiC;AACrD,SACEC,IAAI,EACJC,gBAAgB,EAChBC,QAAQ,EAERC,KAAK,QACA,cAAc;AAC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