ConversationView: Improve types

This commit is contained in:
Scott Nonnenberg
2021-08-30 14:32:56 -07:00
committed by GitHub
parent c765d3202c
commit dcf29078f4
21 changed files with 1101 additions and 941 deletions

View File

@@ -48,11 +48,13 @@ export async function handleImageAttachment(
const blurHash = await imageToBlurHash(resizedBlob);
return {
fileName: fileName || file.name,
blurHash,
contentType,
data,
fileName: fileName || file.name,
path: file.name,
pending: false,
size: data.byteLength,
blurHash,
};
}

View File

@@ -16,7 +16,7 @@ export async function longRunningTaskWrapper<T>({
const ONE_SECOND = 1000;
const TWO_SECONDS = 2000;
let progressView: typeof window.Whisper.ReactWrapperView | undefined;
let progressView: Backbone.View | undefined;
let spinnerStart;
let progressTimeout: NodeJS.Timeout | undefined = setTimeout(() => {
window.log.info(`longRunningTaskWrapper/${idLog}: Creating spinner`);
@@ -76,11 +76,13 @@ export async function longRunningTaskWrapper<T>({
// Note: this component uses a portal to render itself into the top-level DOM. No
// need to attach it to the DOM here.
const errorView = new window.Whisper.ReactWrapperView({
const errorView: Backbone.View = new window.Whisper.ReactWrapperView({
className: 'error-modal-wrapper',
Component: window.Signal.Components.ErrorModal,
props: {
onClose: () => errorView.remove(),
onClose: (): void => {
errorView.remove();
},
},
});
}