@@ -1,6 +1,5 @@ | |||
<!DOCTYPE html> | |||
<html> | |||
<title>PicoChat!</title> | |||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |||
<script src="https://unpkg.com/mithril/mithril.min.js"></script> | |||
<script src="/pico.js" defer></script> |
@@ -21,6 +21,17 @@ listen('post', ({detail}) => State.posts.push(detail)) | |||
listen('peerInfo', (e) => onPeerInfo(e)) | |||
const doNotLog = new Set(['login', 'post', 'peerInfo']) | |||
/* | |||
* | |||
* ALERTS | |||
* | |||
*/ | |||
State.unseen = 0 | |||
listen('post', () => {State.unseen += !document.hasFocus(); updateTitle()}) | |||
listen('focus', () => {State.unseen = 0; updateTitle()}) | |||
const updateTitle = () => { | |||
document.title = `Pico.Chat` + (State.unseen ? ` (${State.unseen})` : ``) | |||
} | |||
/* | |||
* |