Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
update logout
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Oct 4, 2020
1 parent 2cc67c1 commit 0dc3bb0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions apiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1011,20 +1011,21 @@ class ApiClient {

const done = () => {
this.setAuthenticationInfo(null, null);
return Promise.resolve();
};

if (this.accessToken()) {
const url = this.getUrl("Sessions/Logout");

return this.ajax({
type: "POST",
url
url,
timeout: 10000

}).then(done, done);
}

done();
return Promise.resolve();
return done();
}

/**
Expand Down Expand Up @@ -4530,6 +4531,15 @@ class ApiClient {
return this.getJSON(this.getUrl(`Users/${this.getCurrentUserId()}/Items/Latest`, options));
}

getPlayQueue(options) {

if (!this.isMinServerVersion('4.6')) {
return Promise.resolve({ Items: [], TotalRecordCount: 0 });
}

return this.getJSON(this.getUrl('Sessions/PlayQueue', options));
}

supportsWakeOnLan() {

if (!this.wakeOnLan.isSupported()) {
Expand Down

0 comments on commit 0dc3bb0

Please sign in to comment.