Фикс синхронизации после подтверждения девайса

This commit is contained in:
RoyceDa
2026-02-16 20:16:12 +02:00
parent 432b270b34
commit 2045bf284e
3 changed files with 6 additions and 13 deletions

View File

@@ -21,15 +21,10 @@ export function useSynchronize() {
const {protocol} = useProtocol();
useEffect(() => {
const handshake_complete = () => {
if(protocol.handshakeExchangeComplete){
trySync();
}
protocol.on('handshake_complete', handshake_complete);
return () => {
protocol.off('handshake_complete', handshake_complete);
}
}, [protocol]);
}, [protocol.handshakeExchangeComplete]);
const trySync = async () => {
const lastSyncTime = await getQuery(`SELECT last_sync FROM accounts_sync_times WHERE account = ?`, [publicKey]);

View File

@@ -34,7 +34,7 @@ export default class Protocol extends EventEmitter {
private _supportedPackets: Map<number, Packet> = new Map();
private _packetWaiters: Map<number, ((packet: any) => void)[]> = new Map();
private _packetQueue: Packet[] = []; // Очередь для пакетов
private handshakeExchangeComplete : boolean = false;
public handshakeExchangeComplete : boolean = false;
private heartbeatIntervalTimer : NodeJS.Timeout | null = null;
constructor(serverAddress: string) {

View File

@@ -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 RELEASE_NOTICE = `
**Update v0.9.9** :emoji_1f631:
- Synchronization devices!
- New fast server
- Fix login select account bug
**Update v1.0.0** :emoji_1f631:
- Full sync support with message history and attachments
`;