Notification settings (#807)

* Add account data hook

* Add options to change global notification

* Add options to add keywords

* Fix wrong notification count

* Show unread badge in favicon (#251)

* Fix favicon badge

* Fix bug

* Fix favicon not updating

* Add favicon svg's

* remove dead code
This commit is contained in:
Ajay Bura 2022-09-04 13:10:07 +05:30 committed by GitHub
parent ac155bbf4c
commit 584fa87bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 587 additions and 39 deletions

View file

@ -115,6 +115,19 @@ export function avatarInitials(text) {
return [...text][0];
}
export function cssVar(name) {
return getComputedStyle(document.body).getPropertyValue(name);
}
export function setFavicon(url) {
const oldFav = document.querySelector('[rel=icon]');
oldFav.parentElement.removeChild(oldFav);
const fav = document.createElement('link');
fav.rel = 'icon';
fav.href = url;
document.head.appendChild(fav);
}
export function copyToClipboard(text) {
if (navigator.clipboard) {
navigator.clipboard.writeText(text);