@@ -12,7 +12,7 @@ import {
12
12
ComAtprotoLabelDefs ,
13
13
RichText ,
14
14
} from "@atproto/api" ;
15
- import { useMutation , useQueryClient } from "@tanstack/react-query" ;
15
+ import { useMutation } from "@tanstack/react-query" ;
16
16
import { detectLanguage , jsonToText } from "@/lib/utils/text" ;
17
17
import { compressImage } from "@/lib/utils/image" ;
18
18
import { JSONContent } from "@tiptap/react" ;
@@ -45,7 +45,6 @@ export default function usePublishPost(props: Props) {
45
45
label,
46
46
threadGate,
47
47
} = props ;
48
- const queryClient = useQueryClient ( ) ;
49
48
const MAX_POST_LENGTH = 300 ;
50
49
51
50
return useMutation ( {
@@ -65,7 +64,7 @@ export default function usePublishPost(props: Props) {
65
64
66
65
if ( richText . graphemeLength > MAX_POST_LENGTH ) {
67
66
throw new Error (
68
- "Post length exceeds the maximum length of 300 characters" ,
67
+ "Post length exceeds the maximum length of 300 characters"
69
68
) ;
70
69
}
71
70
@@ -140,7 +139,7 @@ export default function usePublishPost(props: Props) {
140
139
new Uint8Array ( await blob . arrayBuffer ( ) ) ,
141
140
{
142
141
encoding : blob . type ,
143
- } ,
142
+ }
144
143
) ;
145
144
146
145
embedImages . images . push ( {
@@ -202,13 +201,13 @@ export default function usePublishPost(props: Props) {
202
201
try {
203
202
const image = await fetch ( linkCard . image ) ;
204
203
const blob = await compressImage (
205
- ( await image . blob ( ) ) as UploadImage ,
204
+ ( await image . blob ( ) ) as UploadImage
206
205
) ;
207
206
const uploaded = await agent . uploadBlob (
208
207
new Uint8Array ( await blob . arrayBuffer ( ) ) ,
209
208
{
210
209
encoding : blob . type ,
211
- } ,
210
+ }
212
211
) ;
213
212
embedExternal . external . thumb = uploaded . data . blob ;
214
213
} catch ( e ) {
@@ -258,7 +257,7 @@ export default function usePublishPost(props: Props) {
258
257
259
258
await agent . api . app . bsky . feed . threadgate . create (
260
259
{ repo : agent . session ! . did , rkey : submittedPost . rkey } ,
261
- { post : result . uri , createdAt : new Date ( ) . toISOString ( ) , allow } ,
260
+ { post : result . uri , createdAt : new Date ( ) . toISOString ( ) , allow }
262
261
) ;
263
262
}
264
263
} ,
0 commit comments