So, I'm creating a custom route to use with my plugin by using a template along with some javascript code inside the static/lib directory.
Now, whenever I load the page, a piece of code inside the template is not getting loaded unless I refresh the page while on it.
This is the code that doesn't get displayed:
{{{ if (isOwner || (isStaff && (!character.validated || !character.editable))) }}}
<div class="container mt-3 ps-0">
{{{ if (isOwner && character.editable) }}}
<a href="/rpg/character/edit?uid={character.owner_id}" role="button" class="btn btn-secondary">Editar</a>
{{{ end }}}
{{{ if (isStaff && !character.validated) }}}
<button id="validate-character-sheet" class="btn btn-secondary">Aprobar</button>
<button id="fix-character-sheet" class="btn btn-secondary">Solicitar corrección</button>
{{{ end }}}
{{{ if (isStaff && !character.editable) }}}
<button id="allow-edit-character-sheet" class="btn btn-secondary">Habilitar edición</button>
{{{ end }}}
</div>
{{{ end }}}
Every validation and button inside of it works just fine once I refresh the page.
Is there anything I'm doing wrong in here?