mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-13 22:32:26 +03:00
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:
parent
ac155bbf4c
commit
584fa87bbd
15 changed files with 587 additions and 39 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue