Skip to content

Commit a142a00

Browse files
authored
Merge pull request #1444 from Bilb/fix-show-loader-attachment-while-no-url
Merge pull request #17 from session-foundation/unstable
2 parents 41e6f9d + f9f69b9 commit a142a00

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ts/components/conversation/Image.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const Image = (props: Props) => {
8383
const canClick = onClick && !pending;
8484
const role = canClick ? 'button' : undefined;
8585

86-
const onErrorUrlFilterering = useCallback(() => {
86+
const onErrorUrlFiltering = useCallback(() => {
8787
if (mounted && url && urlToLoad === '' && onError) {
8888
onError();
8989
setPending(false);
@@ -96,19 +96,19 @@ export const Image = (props: Props) => {
9696
useEffect(() => {
9797
if (mounted && url === '') {
9898
setPending(false);
99-
onErrorUrlFilterering();
99+
onErrorUrlFiltering();
100100
}
101101

102102
if (mounted && imageBroken && urlToLoad === '') {
103103
setPending(false);
104-
onErrorUrlFilterering();
104+
onErrorUrlFiltering();
105105
}
106106

107107
if (url) {
108108
setPending(false);
109109
setMounted(!loading && !pending);
110110
}
111-
}, [imageBroken, loading, mounted, onErrorUrlFilterering, pending, url, urlToLoad]);
111+
}, [imageBroken, loading, mounted, onErrorUrlFiltering, pending, url, urlToLoad]);
112112

113113
if (mounted && imageBroken) {
114114
return (
@@ -145,7 +145,7 @@ export const Image = (props: Props) => {
145145
}}
146146
data-attachmentindex={attachmentIndex}
147147
>
148-
{!mounted ? (
148+
{!mounted || !urlToLoad ? (
149149
<div
150150
className="module-image__loading-placeholder"
151151
style={{
@@ -161,7 +161,7 @@ export const Image = (props: Props) => {
161161
</div>
162162
) : (
163163
<img
164-
onError={onErrorUrlFilterering}
164+
onError={onErrorUrlFiltering}
165165
className={clsx('module-image__image', forceSquare ? 'module-image__image-cover' : '')}
166166
alt={alt}
167167
style={{

ts/session/onions/onionSend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ const sendViaOnionV4ToNonSnodeWithRetries = async (
274274
// NOTE if there are no snodes available, we want to refresh the snode pool from the seed
275275
if (e instanceof OnionPathEmptyError) {
276276
window?.log?.warn(
277-
'endViaOnionV4ToNonSnodeWithRetries failed, no path available, refreshing snode pool'
277+
'sendViaOnionV4ToNonSnodeWithRetries failed, no path available, refreshing snode pool'
278278
);
279279
void SnodePool.forceRefreshRandomSnodePool();
280280
}

0 commit comments

Comments
 (0)