MCPcopy Create free account
hub / github.com/firebase/quickstart-js / setCommentValues

Function setCommentValues

database/scripts/main.ts:403–414  ·  view source on GitHub ↗

* Sets the comment's values in the given postElement.

(
  postElement: HTMLElement,
  id: string,
  text: string,
  author: string,
)

Source from the content-addressed store, hash-verified

401 * Sets the comment's values in the given postElement.
402 */
403function setCommentValues(
404 postElement: HTMLElement,
405 id: string,
406 text: string,
407 author: string,
408) {
409 const comment = postElement.getElementsByClassName('comment-' + id)[0];
410 (comment.getElementsByClassName('comment')[0] as HTMLElement).innerText =
411 text;
412 (comment.getElementsByClassName('fp-username')[0] as HTMLElement).innerText =
413 author;
414}
415
416/**
417 * Deletes the comment of the given ID in the given postElement.

Callers 1

createPostElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected