Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

画像にローディング表示を追加 #382

Merged
merged 4 commits into from
Mar 12, 2024
Merged

画像にローディング表示を追加 #382

merged 4 commits into from
Mar 12, 2024

Conversation

wadabee
Copy link
Contributor

@wadabee wadabee commented Mar 11, 2024

Issue #, if available:
#361

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines -62 to -75
useEffect(() => {
// アップロードされたファイルの URL が更新されたら Signed URL を更新
if (uploadedFiles) {
Promise.all(
uploadedFiles.map(async (file) => {
return await getDocDownloadSignedUrl(file.source.data);
})
).then((results) => setSignedUrls(results));
} else {
setSignedUrls([]);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [uploadedFiles]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

アップロード直後は、ローカルでエンコードしたBASE64の画像を表示するようにしました(レイテンシ改善のため)

packages/web/src/hooks/useFiles.ts Outdated Show resolved Hide resolved
packages/web/src/hooks/useFiles.ts Outdated Show resolved Hide resolved
packages/web/src/components/ChatMessage.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@maekawataiki maekawataiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wadabee wadabee merged commit 6bab297 into main Mar 12, 2024
1 check passed
@wadabee wadabee deleted the loading-image branch March 12, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants