Guard initial fit sizing
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "textual-webterm"
|
name = "textual-webterm"
|
||||||
version = "0.3.22"
|
version = "0.3.23"
|
||||||
description = "Serve terminal sessions over the web"
|
description = "Serve terminal sessions over the web"
|
||||||
authors = ["Will McGugan <will@textualize.io>"]
|
authors = ["Will McGugan <will@textualize.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -190,7 +190,13 @@ class WebTerminal {
|
|||||||
const maxAttempts = 120;
|
const maxAttempts = 120;
|
||||||
|
|
||||||
const attemptFitAndResize = (attempt: number) => {
|
const attemptFitAndResize = (attempt: number) => {
|
||||||
const dims = this.fitAddon.proposeDimensions();
|
const dims = (() => {
|
||||||
|
try {
|
||||||
|
return this.fitAddon.proposeDimensions();
|
||||||
|
} catch {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
})();
|
||||||
if (!dims) {
|
if (!dims) {
|
||||||
if (attempt < maxAttempts) {
|
if (attempt < maxAttempts) {
|
||||||
window.requestAnimationFrame(() => attemptFitAndResize(attempt + 1));
|
window.requestAnimationFrame(() => attemptFitAndResize(attempt + 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user