|
|
|
@ -220,17 +220,15 @@ export class SessionProtocol {
|
|
|
|
timestamp: number | undefined,
|
|
|
|
timestamp: number | undefined,
|
|
|
|
map: StringToNumberMap
|
|
|
|
map: StringToNumberMap
|
|
|
|
): Promise<boolean> {
|
|
|
|
): Promise<boolean> {
|
|
|
|
|
|
|
|
if (map[device] === timestamp) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!timestamp) {
|
|
|
|
if (!timestamp) {
|
|
|
|
if (device in map) {
|
|
|
|
|
|
|
|
// tslint:disable-next-line: no-dynamic-delete
|
|
|
|
// tslint:disable-next-line: no-dynamic-delete
|
|
|
|
delete map[device];
|
|
|
|
delete map[device];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map[device] = timestamp;
|
|
|
|
map[device] = timestamp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|