allow for injectable server discovery

This commit is contained in:
Luke Pulverenti 2015-02-16 15:56:57 -05:00
parent 61f7ca1da4
commit 6ba570e062
3 changed files with 91 additions and 26 deletions

View file

@ -23,7 +23,7 @@
}
function set(data) {
if (data) {
credentials = data;
store.setItem(key, JSON.stringify(data));
@ -53,8 +53,9 @@
})[0];
if (existing) {
// Merge the data
existing.DateLastAccessed = Math.max(existing.DateLastAccessed || 0, server.DateLastAccessed || 0, new Date().getTime());
existing.DateLastAccessed = Math.max(existing.DateLastAccessed || 0, server.DateLastAccessed || 0);
if (server.AccessToken) {
existing.AccessToken = server.AccessToken;