Skip to content
Snippets Groups Projects
Commit 907dafa3 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

last request timestamp is available in session data

parent 289eff0e
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!421Resolve "Session expiry notification"
......@@ -15,6 +15,7 @@ var ConfigurationType = {
REQUEST_ACCOUNT_EMAIL: "REQUEST_ACCOUNT_EMAIL",
REQUEST_ACCOUNT_DEFAULT_CONTENT: "REQUEST_ACCOUNT_DEFAULT_CONTENT",
SIMPLE_COLOR_VAL: "SIMPLE_COLOR_VAL",
SESSION_LENGTH: "SESSION_LENGTH",
SHOW_ELEMENT_ABBREVIATION: "SHOW_ELEMENT_ABBREVIATION",
SHOW_ELEMENT_ANNOTATIONS: "SHOW_ELEMENT_ANNOTATIONS",
SHOW_ELEMENT_CHARGE: "SHOW_ELEMENT_CHARGE",
......
......@@ -15,12 +15,33 @@ var logger = require('./logger');
* @constructor
*/
function SessionData(project) {
var self = this;
if (project === undefined) {
throw new Error("Project must be passed as an argument");
}
this.setProject(project);
self.setProject(project);
ServerConnector.addListener("onDataLoadStart", function () {
self.setLastRequestTimeStamp(Math.floor(Date.now() / 1000));
});
}
/**
*
* @param {number} timestamp time stamp in seconds
*/
SessionData.prototype.setLastRequestTimeStamp = function (timestamp) {
this._lastRequestTimeStamp = timestamp;
};
/**
*
* @returns {number} time stamp in seconds
*/
SessionData.prototype.getLastRequestTimeStamp = function () {
return this._lastRequestTimeStamp;
};
/**
*
* @param {Project} project
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment