favicon matches room logo

This commit is contained in:
Tenzin Passang 2021-11-12 19:29:28 +02:00 committed by N-Pex
parent 38e6dfa0e6
commit f042e61154
3 changed files with 24 additions and 4 deletions

View file

@ -127,6 +127,16 @@ export default {
}
return title;
},
favicon() {
var favicon = undefined;
if (this.$route.meta.includeFavicon) {
if (this.$matrix.currentRoom) {
favicon = this.$matrix.currentRoom.avatar || 'favicon.ico';
}
}
return favicon;
},
},
watch: {
"$i18n.locale": {
@ -149,6 +159,13 @@ export default {
},
immediate: true,
},
favicon: {
handler(favicon) {
document.getElementById("favicon").setAttribute('href', favicon);
},
immediate: true,
},
},
};
</script>