Фикс синхронизации после подтверждения девайса
This commit is contained in:
@@ -21,15 +21,10 @@ export function useSynchronize() {
|
|||||||
const {protocol} = useProtocol();
|
const {protocol} = useProtocol();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handshake_complete = () => {
|
if(protocol.handshakeExchangeComplete){
|
||||||
trySync();
|
trySync();
|
||||||
}
|
}
|
||||||
protocol.on('handshake_complete', handshake_complete);
|
}, [protocol.handshakeExchangeComplete]);
|
||||||
|
|
||||||
return () => {
|
|
||||||
protocol.off('handshake_complete', handshake_complete);
|
|
||||||
}
|
|
||||||
}, [protocol]);
|
|
||||||
|
|
||||||
const trySync = async () => {
|
const trySync = async () => {
|
||||||
const lastSyncTime = await getQuery(`SELECT last_sync FROM accounts_sync_times WHERE account = ?`, [publicKey]);
|
const lastSyncTime = await getQuery(`SELECT last_sync FROM accounts_sync_times WHERE account = ?`, [publicKey]);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default class Protocol extends EventEmitter {
|
|||||||
private _supportedPackets: Map<number, Packet> = new Map();
|
private _supportedPackets: Map<number, Packet> = new Map();
|
||||||
private _packetWaiters: Map<number, ((packet: any) => void)[]> = new Map();
|
private _packetWaiters: Map<number, ((packet: any) => void)[]> = new Map();
|
||||||
private _packetQueue: Packet[] = []; // Очередь для пакетов
|
private _packetQueue: Packet[] = []; // Очередь для пакетов
|
||||||
private handshakeExchangeComplete : boolean = false;
|
public handshakeExchangeComplete : boolean = false;
|
||||||
private heartbeatIntervalTimer : NodeJS.Timeout | null = null;
|
private heartbeatIntervalTimer : NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
constructor(serverAddress: string) {
|
constructor(serverAddress: string) {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
export const APP_VERSION = "0.9.9";
|
export const APP_VERSION = "1.0.0";
|
||||||
export const CORE_MIN_REQUIRED_VERSION = "1.4.8";
|
export const CORE_MIN_REQUIRED_VERSION = "1.4.8";
|
||||||
|
|
||||||
export const RELEASE_NOTICE = `
|
export const RELEASE_NOTICE = `
|
||||||
**Update v0.9.9** :emoji_1f631:
|
**Update v1.0.0** :emoji_1f631:
|
||||||
- Synchronization devices!
|
- Full sync support with message history and attachments
|
||||||
- New fast server
|
|
||||||
- Fix login select account bug
|
|
||||||
`;
|
`;
|
||||||
Reference in New Issue
Block a user