File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2222 </p >
2323 </div >
2424
25+ <p v-if =" displayWarning" class =" warning-message" >
26+ The message you're trying to send was flagged as offensive. Please consider minding the language you use in this meeting.
27+ </p >
28+
2529 <form @submit =" submitForm" >
2630 <div class =" input" >
2731 <label for =" message" >Type a message...</label >
@@ -59,7 +63,8 @@ export default {
5963 chat,
6064 send,
6165 text: " " ,
62- model: null
66+ model: null ,
67+ displayWarning: false ,
6368 };
6469 },
6570 beforeCreate () {
@@ -76,9 +81,10 @@ export default {
7681 // Send chat message using prop method from CallTile.vue
7782 async submitForm (e ) {
7883 e .preventDefault ();
84+ this .displayWarning = false ;
7985
8086 const hasToxicContent = await this .analyzeInputText (this .text );
81- // this.sendMessage(this.text);
87+ hasToxicContent ? this . displayWarning = true : this .sendMessage (this .text );
8288 this .text = " " ;
8389 },
8490 async analyzeInputText (text ) {
@@ -169,6 +175,10 @@ form {
169175 color : #6b7785 ;
170176}
171177
178+ .warning-message {
179+ color : red ;
180+ }
181+
172182@media screen and (max-width : 700px ) {
173183 .chat-container {
174184 width : calc (100% - 104px );
You can’t perform that action at this time.
0 commit comments