File tree 1 file changed +5
-4
lines changed
interfaces/src/main/kotlin/com/noxcrew/interfaces
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
133
133
private data class ChatQuery (
134
134
val view : InterfaceView ,
135
135
val onCancel : suspend () -> Unit ,
136
- val onComplete : suspend (Component ) -> Unit ,
136
+ val onComplete : suspend (Component ) -> Boolean ,
137
137
val id : UUID
138
138
)
139
139
@@ -499,8 +499,9 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
499
499
500
500
// Complete the query and re-open the view
501
501
SCOPE .launch {
502
- query.onComplete(event.message())
503
- query.view.open()
502
+ if (query.onComplete(event.message())) {
503
+ query.view.open()
504
+ }
504
505
}
505
506
506
507
// Prevent the message from sending
@@ -641,7 +642,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
641
642
view : InterfaceView ,
642
643
timeout : Duration ,
643
644
onCancel : suspend () -> Unit ,
644
- onComplete : suspend (Component ) -> Unit
645
+ onComplete : suspend (Component ) -> Boolean
645
646
) {
646
647
// Determine if the player has this inventory open
647
648
if (! view.isOpen()) return
You can’t perform that action at this time.
0 commit comments