From f76bebf2d8c29aa3b44907f3470d2a4d85cf40ed Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 21 Aug 2013 17:56:08 +0200 Subject: fixed time in account --- pyload/web/app/scripts/models/Account.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyload/web/app/scripts/models/Account.js b/pyload/web/app/scripts/models/Account.js index 94893f3e2..dc453ef3c 100644 --- a/pyload/web/app/scripts/models/Account.js +++ b/pyload/web/app/scripts/models/Account.js @@ -3,8 +3,6 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt return Backbone.Model.extend({ - // TODO - // generated, not submitted idAttribute: 'loginname', defaults: { @@ -36,6 +34,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt return new ConfigItem(item); }); + // JS uses time based on ms + if (resp.validuntil > 0) + resp.validuntil *= 1000; + return resp; }, @@ -58,7 +60,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt save: function() { // use changed config items only var data = this.toJSON(); - data.config = _.map(_.filter(data.config, function(c){ + data.config = _.map(_.filter(data.config, function(c) { return c.isChanged(); }), function(c) { return c.prepareSave(); -- cgit v1.2.3