 							Dom.text tr("sending")
 							renderDots()
 
+
 	typingSub = Obs.create {}
-	Server.send "typingSub", (delta) !-> typingSub.patch delta
-	Obs.observe !->
+	Server.send 'typingSub', (delta) !-> typingSub.patch delta
+	Obs.observe !->
+		wasNearBottom2 = Page.nearBottom()
 		users = []
 		for userId of typingSub.get()
 			if +userId isnt Plugin.userId()

				else
					Dom.text tr(" are typing")
				renderDots()

	Obs.observe !->
		shared.get("maxId")
		typingSub.get()
		#if Page.nearBottom()
		Page.scroll('down', isRendered)
	isRendered = true

	Page.setFooter !->

	myUserId = Plugin.userId()
	happeningId = Plugin.groupId()

	if fv = Page.state.get('_firstV')
		firstV = Obs.create(fv)
	else
		msgAmount = Math.max(Math.round(Dom.viewport.peek('height')/50), 10)
			# show at least 10 messages, but more when we have a large vertical viewport
		firstV = Obs.create Math.max(1, (shared.peek('maxId')||0)-msgAmount)

	screenE = Dom.get()
	Dom.div !->
