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

Function onMessageFormSubmit

web/src/index.js:218–228  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

216
217 // Triggered when the send new message form is submitted.
218 function onMessageFormSubmit(e) {
219 e.preventDefault();
220 // Check that the user entered a message and is signed in.
221 if (messageInputElement.value && checkSignedInWithMessage()) {
222 saveMessage(messageInputElement.value).then(function() {
223 // Clear message text field and re-enable the SEND button.
224 resetMaterialTextfield(messageInputElement);
225 toggleButton();
226 });
227 }
228 }
229
230 // Triggers when the auth state change for instance when the user signs-in or signs-out.
231 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