Skip to content

Commit

Permalink
fix when login function is not async
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 27, 2022
1 parent bda529d commit 957abb5
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 58 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@
* fix re-rendering of jQuery/DOM nodes [#759](https://github.com/jcubic/jquery.terminal/issues/759)
* fix regression in less + images
* fix embedding Terminal inside SVG [#744](https://github.com/jcubic/jquery.terminal/issues/744)
* fix when login function is not async

## 2.32.1
### Bugfix
Expand Down
36 changes: 17 additions & 19 deletions js/jquery.terminal-2.32.1.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 27 Mar 2022 15:03:58 +0000
* Date: Sun, 27 Mar 2022 22:48:55 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5169,7 +5169,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 27 Mar 2022 15:03:58 +0000',
date: 'Sun, 27 Mar 2022 22:48:55 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9291,21 +9291,19 @@
silent) {
login_callback(user, token, silent);
});
if (ret && is_function(ret.then || ret.done)) {
(ret.then || ret.done).call(ret, function(token) {
login_callback(user, token);
}).catch(function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
}
unpromise(ret, function(token) {
login_callback(user, token);
}, function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
} catch (e) {
display_exception(e, 'AUTH');
}
Expand Down Expand Up @@ -11750,7 +11748,6 @@
var width = fill.width();
var height = fill.height();
var new_pixel_density = get_pixel_size();
console.log({new_pixel_density});
css(self[0], {
'--pixel-density': new_pixel_density
});
Expand Down Expand Up @@ -11791,7 +11788,8 @@
}
function create_bottom_detect() {
if (window.IntersectionObserver) {
var top = $('<div class="terminal-scroll-marker"/>').appendTo(scroller);
var top = $('<div class="terminal-scroll-marker"/>')
.appendTo(scroller);
var marker = top;
if (settings.scrollBottomOffset !== -1) {
var style = style_prop('height', settings.scrollBottomOffset);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.32.1.min.js

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions js/jquery.terminal-src.js
Expand Up @@ -9291,21 +9291,19 @@
silent) {
login_callback(user, token, silent);
});
if (ret && is_function(ret.then || ret.done)) {
(ret.then || ret.done).call(ret, function(token) {
login_callback(user, token);
}).catch(function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
}
unpromise(ret, function(token) {
login_callback(user, token);
}, function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
} catch (e) {
display_exception(e, 'AUTH');
}
Expand Down
36 changes: 17 additions & 19 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 27 Mar 2022 15:03:58 +0000
* Date: Sun, 27 Mar 2022 22:48:55 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5169,7 +5169,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 27 Mar 2022 15:03:58 +0000',
date: 'Sun, 27 Mar 2022 22:48:55 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9291,21 +9291,19 @@
silent) {
login_callback(user, token, silent);
});
if (ret && is_function(ret.then || ret.done)) {
(ret.then || ret.done).call(ret, function(token) {
login_callback(user, token);
}).catch(function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
}
unpromise(ret, function(token) {
login_callback(user, token);
}, function(err) {
self.pop(undefined, true).pop(undefined, true);
self.error(err.message);
if (is_function(error)) {
error();
}
if (self.paused()) {
self.resume();
}
self.off('terminal.autologin');
});
} catch (e) {
display_exception(e, 'AUTH');
}
Expand Down Expand Up @@ -11750,7 +11748,6 @@
var width = fill.width();
var height = fill.height();
var new_pixel_density = get_pixel_size();
console.log({new_pixel_density});
css(self[0], {
'--pixel-density': new_pixel_density
});
Expand Down Expand Up @@ -11791,7 +11788,8 @@
}
function create_bottom_detect() {
if (window.IntersectionObserver) {
var top = $('<div class="terminal-scroll-marker"/>').appendTo(scroller);
var top = $('<div class="terminal-scroll-marker"/>')
.appendTo(scroller);
var marker = top;
if (settings.scrollBottomOffset !== -1) {
var style = style_prop('height', settings.scrollBottomOffset);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 957abb5

Please sign in to comment.