feat: update document.title on navigation

This commit is contained in:
Ayo 2023-06-15 13:03:49 +02:00
parent 4470a4252c
commit d4ff337844

View file

@ -77,6 +77,9 @@ export function renderPost(responseText, url, postDivSelector: string, preventPu
const submitBtn = document.getElementById('submit') as HTMLButtonElement; const submitBtn = document.getElementById('submit') as HTMLButtonElement;
const title = html.querySelector('meta[property="cozy:title"]')?.getAttribute('content');
document.title = `Cozy 🧸 | ${title}` || 'Cozy 🧸';
if(cozyUrl !== '/') { if(cozyUrl !== '/') {
appUrl.value = cozyUrl || ''; appUrl.value = cozyUrl || '';
homeBtn.removeAttribute('disabled'); homeBtn.removeAttribute('disabled');