File tree 1 file changed +41
-30
lines changed 1 file changed +41
-30
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,11 @@ export function HomePageFeedUpdate({
135
135
queryClient . refetchQueries ( '/api/fauna/all-updates' )
136
136
queryClient . refetchQueries ( [ '/api/fauna/recent-updates' , goal . id ] )
137
137
} ,
138
+ onError : ( ) => {
139
+ toast . error ( 'Something went wrong!!!' , {
140
+ id : toastId . current ,
141
+ } )
142
+ } ,
138
143
}
139
144
)
140
145
@@ -192,38 +197,44 @@ export function HomePageFeedUpdate({
192
197
</ p >
193
198
</ div >
194
199
195
- < div className = "flex-shrink-0 self-center flex" >
196
- < div className = "relative inline-block text-left" >
197
- < Menu
198
- trigger = {
199
- < button className = "-m-2 p-2 rounded-full flex items-center text-gray-400 hover:text-gray-600" >
200
- < span className = "sr-only" > Open quick actions</ span >
201
- < DotsThreeOutlineVertical
202
- className = "h-5 w-5"
203
- aria-hidden = { true }
204
- />
205
- </ button >
206
- }
207
- >
208
- < Menu . Item
209
- icon = { Pencil }
210
- onClick = { ( ) => setIsInEditMode ( true ) }
200
+ { session && ( session . user as User ) . id === update . postedBy . id && (
201
+ < div className = "flex-shrink-0 self-center flex" >
202
+ < div className = "relative inline-block text-left" >
203
+ < Menu
204
+ trigger = {
205
+ < button className = "-m-2 p-2 rounded-full flex items-center text-gray-400 hover:text-gray-600" >
206
+ < span className = "sr-only" >
207
+ Open quick actions
208
+ </ span >
209
+ < DotsThreeOutlineVertical
210
+ className = "h-5 w-5"
211
+ aria-hidden = { true }
212
+ />
213
+ </ button >
214
+ }
211
215
>
212
- Edit
213
- </ Menu . Item >
214
- < Menu . Item
215
- icon = { Trash }
216
- onClick = { ( ) => {
217
- deleteUpdate ( )
218
- const id = toast . loading ( 'Deleting your update...' )
219
- toastId . current = id
220
- } }
221
- >
222
- Delete
223
- </ Menu . Item >
224
- </ Menu >
216
+ < Menu . Item
217
+ icon = { Pencil }
218
+ onClick = { ( ) => setIsInEditMode ( true ) }
219
+ >
220
+ Edit
221
+ </ Menu . Item >
222
+ < Menu . Item
223
+ icon = { Trash }
224
+ onClick = { ( ) => {
225
+ deleteUpdate ( )
226
+ const id = toast . loading (
227
+ 'Deleting your update...'
228
+ )
229
+ toastId . current = id
230
+ } }
231
+ >
232
+ Delete
233
+ </ Menu . Item >
234
+ </ Menu >
235
+ </ div >
225
236
</ div >
226
- </ div >
237
+ ) }
227
238
</ div >
228
239
< div className = "mt-4 flex" >
229
240
< button
You can’t perform that action at this time.
0 commit comments