Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
122
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix pasting images on web (#4670)

authored by

dan and committed by
GitHub
58102377 49396451

+7 -8
+7 -8
src/view/com/composer/text-input/TextInput.web.tsx
··· 152 152 }, 153 153 handlePaste: (view, event) => { 154 154 const clipboardData = event.clipboardData 155 + let preventDefault = false 155 156 156 157 if (clipboardData) { 157 158 if (clipboardData.types.includes('text/html')) { 158 159 // Rich-text formatting is pasted, try retrieving plain text 159 160 const text = clipboardData.getData('text/plain') 160 - 161 161 // `pasteText` will invoke this handler again, but `clipboardData` will be null. 162 162 view.pasteText(text) 163 - 163 + preventDefault = true 164 + } 165 + getImageFromUri(clipboardData.items, (uri: string) => { 166 + textInputWebEmitter.emit('photo-pasted', uri) 167 + }) 168 + if (preventDefault) { 164 169 // Return `true` to prevent ProseMirror's default paste behavior. 165 170 return true 166 - } else { 167 - // Otherwise, try retrieving images from the clipboard 168 - 169 - getImageFromUri(clipboardData.items, (uri: string) => { 170 - textInputWebEmitter.emit('photo-pasted', uri) 171 - }) 172 171 } 173 172 } 174 173 },