mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-29 22:07:46 +03:00
refetching fresh speak videos every second if even one of item is under processing
This commit is contained in:
parent
c1cfb81156
commit
f00d27575d
@ -563,8 +563,8 @@
|
||||
"failed_count":"Failed to upload {failedCount} of {totalCount} selected image(s)",
|
||||
"publish_manual":"Ready",
|
||||
"published":"Published",
|
||||
"encoding_ipfs":"Encoding",
|
||||
"encoding_preparing":"Preparing",
|
||||
"encoding_ipfs":"Encoding...",
|
||||
"encoding_preparing":"Preparing...",
|
||||
"deleted":"Deleted"
|
||||
},
|
||||
"pincode": {
|
||||
|
@ -24,10 +24,25 @@ export const useVideoUploadsQuery = () => {
|
||||
|
||||
const _fetchVideoUploads = async () => getAllVideoStatuses(currentAccount, pinHash);
|
||||
|
||||
// TOOD: filter cache data for post edits to only show already published videos
|
||||
|
||||
const _setRefetchInterval = (data:MediaItem[]|undefined) => {
|
||||
if (data) {
|
||||
const hasPendingItem = data.find((item) =>
|
||||
item.speakData?.status === ThreeSpeakStatus.PREPARING ||
|
||||
item.speakData?.status === ThreeSpeakStatus.ENCODING);
|
||||
|
||||
if(hasPendingItem){
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return useQuery<MediaItem[]>([QUERIES.MEDIA.GET_VIDEOS], _fetchVideoUploads, {
|
||||
initialData: [],
|
||||
refetchInterval: _setRefetchInterval,
|
||||
onError: () => {
|
||||
dispatch(toastNotification(intl.formatMessage({ id: 'alert.fail' })));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user