fix: update fetching desktop release endpoint
parent
15a3c8bc38
commit
4bb857fa53
@ -1,15 +1,20 @@
|
|||||||
|
import { isEmpty } from 'lodash';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import useInterval from 'react-use/lib/useInterval';
|
import useInterval from 'react-use/lib/useInterval';
|
||||||
import { getOurPrimaryConversation } from '../state/selectors/conversations';
|
|
||||||
import { fetchLatestRelease } from '../session/fetch_latest_release';
|
import { fetchLatestRelease } from '../session/fetch_latest_release';
|
||||||
|
import { UserUtils } from '../session/utils';
|
||||||
|
import { getOurPrimaryConversation } from '../state/selectors/conversations';
|
||||||
|
|
||||||
export function useFetchLatestReleaseFromFileServer() {
|
export function useFetchLatestReleaseFromFileServer() {
|
||||||
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
const ourPrimaryConversation = useSelector(getOurPrimaryConversation);
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(async () => {
|
||||||
if (!ourPrimaryConversation) {
|
if (!ourPrimaryConversation) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void fetchLatestRelease.fetchReleaseFromFSAndUpdateMain();
|
const userEd25519SecretKey = (await UserUtils.getUserED25519KeyPairBytes())?.privKeyBytes;
|
||||||
|
if (userEd25519SecretKey && !isEmpty(userEd25519SecretKey)) {
|
||||||
|
void fetchLatestRelease.fetchReleaseFromFSAndUpdateMain(userEd25519SecretKey);
|
||||||
|
}
|
||||||
}, fetchLatestRelease.fetchReleaseFromFileServerInterval);
|
}, fetchLatestRelease.fetchReleaseFromFileServerInterval);
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
declare module 'ip2country';
|
|
Loading…
Reference in New Issue