Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/atomvm/examples/tagboard/js/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class TagBoard extends LitElement {

<div class="tags">${this.renderTags(this._tags)}</div>
<form @submit=${this.onTagSubmit}>
<input placeholder="Mensaje" @input=${this.onTagInput} .value=${this._content} />
<input placeholder="Mensaje" @input=${this.onTagInput} .value=${this._content} maxlength="70" />
<button>Enviar</button>
</form>
`
Expand Down
7 changes: 6 additions & 1 deletion modules/atomvm/examples/tagboard/lib/tag_board_store.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ defmodule TagBoard.Store do
def add_tag(author, content, timestamp) do
case read_tags_from_nvs() do
{:ok, current_tags} ->
new_tag = %{id: timestamp, author: author, content: content, timestamp: timestamp}
new_tag = %{
id: timestamp,
author: author,
content: :string.slice(content, 0, 70),
timestamp: timestamp
}

updated_tags = [new_tag | current_tags]

Expand Down