diff options
-rw-r--r-- | src/lib/api/index.ts | 6 | ||||
-rw-r--r-- | src/view/com/composer/Composer.tsx | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index d94ee4643..440dfa5ee 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -104,12 +104,18 @@ export async function post(agent: BskyAgent, opts: PostOpts) { // add image embed if present if (opts.images?.length) { + logger.info(`Uploading images`, { + count: opts.images.length, + }) + const images: AppBskyEmbedImages.Image[] = [] for (const image of opts.images) { opts.onStateChange?.(`Uploading image #${images.length + 1}...`) + logger.info(`Compressing image`) await image.compress() const path = image.compressed?.path ?? image.path const {width, height} = image.compressed || image + logger.info(`Uploading image`) const res = await uploadBlob(agent, path, 'image/jpeg') images.push({ image: res.data.blob, diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index f510be0be..c4453e0c3 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -62,6 +62,7 @@ import {useProfileQuery} from '#/state/queries/profile' import {useComposerControls} from '#/state/shell/composer' import {emitPostCreated} from '#/state/events' import {ThreadgateSetting} from '#/state/queries/threadgate' +import {logger} from '#/logger' type Props = ComposerOpts export const ComposePost = observer(function ComposePost({ @@ -228,6 +229,11 @@ export const ComposePost = observer(function ComposePost({ }) ).uri } catch (e: any) { + logger.error(e, { + message: `Composer: create post failed`, + hasImages: gallery.size > 0, + }) + if (extLink) { setExtLink({ ...extLink, |