From 9c7e055a2cf7ca5bc517edd3a9f44e128ec40ff3 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 2 Dec 2023 15:53:28 -0500 Subject: fixed jimp upload to not hang when error occurs. fied imagebox to show original image if resized images fail. --- src/client/views/nodes/ImageBox.tsx | 6 ++++-- src/client/views/nodes/LoadingBox.tsx | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/client') diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 7e85c33b8..d28d71fe3 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -319,7 +319,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent { @@ -430,6 +430,8 @@ export class ImageBox extends ViewBoxAnnotatableComponent (this._isHovering = true))} onPointerLeave={action(() => (this._isHovering = false))} key={this.layoutDoc[Id]} ref={this.createDropTarget} onPointerDown={this.marqueeDown}>
- + (this._error = e.toString()))} draggable={false} width={nativeWidth} /> {fadepath === srcpath ? null : (
diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx index 01dd830f8..e554cb8ad 100644 --- a/src/client/views/nodes/LoadingBox.tsx +++ b/src/client/views/nodes/LoadingBox.tsx @@ -63,13 +63,14 @@ export class LoadingBox extends ViewBoxAnnotatableComponent() { const updateFunc = async () => { const result = await Networking.QueryYoutubeProgress(StrCast(this.Document[Id])); // We use the guid of the overwriteDoc to track file uploads. runInAction(() => (this.progress = result.progress)); - !this.Document.loadingError && (this._timer = setTimeout(updateFunc, 1000)); + !this.Document.loadingError && this._timer && (this._timer = setTimeout(updateFunc, 1000)); }; this._timer = setTimeout(updateFunc, 1000); } } componentWillUnmount() { clearTimeout(this._timer); + this._timer = undefined; } render() { -- cgit v1.2.3-70-g09d2