mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Adds error states to story images
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
import type { AttachmentType } from '../types/Attachment';
|
||||
import {
|
||||
hasFailed,
|
||||
hasNotResolved,
|
||||
isDownloaded,
|
||||
isGIF,
|
||||
@@ -18,6 +19,10 @@ const MIN_TEXT_DURATION = 3 * SECOND;
|
||||
export async function getStoryDuration(
|
||||
attachment: AttachmentType
|
||||
): Promise<number | undefined> {
|
||||
if (hasFailed(attachment)) {
|
||||
return DEFAULT_DURATION;
|
||||
}
|
||||
|
||||
if (!isDownloaded(attachment) || hasNotResolved(attachment)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user