MCPcopy Create free account
hub / github.com/firebase/codelab-friendlychat-web / onMessageFormSubmit

Function onMessageFormSubmit

appcheck/hosting/src/index.js:235–245  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

233
234 // Triggered when the send new message form is submitted.
235 function onMessageFormSubmit(e) {
236 e.preventDefault();
237 // Check that the user entered a message and is signed in.
238 if (messageInputElement.value && checkSignedInWithMessage()) {
239 saveMessage(messageInputElement.value).then(function() {
240 // Clear message text field and re-enable the SEND button.
241 resetMaterialTextfield(messageInputElement);
242 toggleButton();
243 });
244 }
245 }
246
247 // Triggers when the auth state change for instance when the user signs-in or signs-out.
248 function authStateObserver(user) {

Callers

nothing calls this directly

Calls 4

checkSignedInWithMessageFunction · 0.70
saveMessageFunction · 0.70
resetMaterialTextfieldFunction · 0.70
toggleButtonFunction · 0.70

Tested by

no test coverage detected