mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
remove getSessionRequest
This commit is contained in:
parent
10e095ba9d
commit
4d2b08f4a2
|
@ -270,34 +270,20 @@ export class SessionProtocol {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a utility function to avoid duplicate code between `getProcessedSessionRequest()` and `getSentSessionRequest()`
|
||||
*/
|
||||
private static async getSessionRequest(
|
||||
device: string,
|
||||
map: StringToNumberMap
|
||||
): Promise<number | undefined> {
|
||||
await SessionProtocol.fetchFromDBIfNeeded();
|
||||
|
||||
return map[device];
|
||||
}
|
||||
|
||||
private static async getSentSessionRequest(
|
||||
device: string
|
||||
): Promise<number | undefined> {
|
||||
return SessionProtocol.getSessionRequest(
|
||||
device,
|
||||
SessionProtocol.sentSessionsTimestamp
|
||||
);
|
||||
await SessionProtocol.fetchFromDBIfNeeded();
|
||||
|
||||
return SessionProtocol.sentSessionsTimestamp[device];
|
||||
}
|
||||
|
||||
private static async getProcessedSessionRequest(
|
||||
device: string
|
||||
): Promise<number | undefined> {
|
||||
return SessionProtocol.getSessionRequest(
|
||||
device,
|
||||
SessionProtocol.processedSessionsTimestamp
|
||||
);
|
||||
await SessionProtocol.fetchFromDBIfNeeded();
|
||||
|
||||
return SessionProtocol.processedSessionsTimestamp[device];
|
||||
}
|
||||
|
||||
private static async hasAlreadySentSessionRequest(
|
||||
|
|
Loading…
Reference in a new issue