mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Stop polling if OAuth popup closed
This commit is contained in:
parent
4944ce1ca0
commit
1e68a81fe1
1 changed files with 3 additions and 2 deletions
|
@ -568,7 +568,6 @@ getPlexOAuthPin = function () {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
headers: x_plex_headers,
|
headers: x_plex_headers,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
plex_oauth_window.location = 'https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + data.code;
|
|
||||||
deferred.resolve({pin: data.id, code: data.code});
|
deferred.resolve({pin: data.id, code: data.code});
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
|
@ -595,6 +594,8 @@ function PlexOAuth(success, error, pre) {
|
||||||
const code = data.code;
|
const code = data.code;
|
||||||
var keep_polling = true;
|
var keep_polling = true;
|
||||||
|
|
||||||
|
plex_oauth_window.location = 'https://app.plex.tv/auth/#!?clientID=' + x_plex_headers['X-Plex-Client-Identifier'] + '&code=' + code;
|
||||||
|
|
||||||
(function poll() {
|
(function poll() {
|
||||||
polling = setTimeout(function () {
|
polling = setTimeout(function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -618,7 +619,7 @@ function PlexOAuth(success, error, pre) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
if (keep_polling){
|
if (keep_polling && !plex_oauth_window.closed){
|
||||||
poll();
|
poll();
|
||||||
} else {
|
} else {
|
||||||
clearTimeout(polling);
|
clearTimeout(polling);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue