// TODO: virtual list, only rerender what's needed so things can keep playing.
/*
Problems
  1. Can't delete, very annoying
    Tombstones. Send all IDs and all Tombstones. Ask only for posts that we don't get a tombstone for. Don't send posts we have a tombstone for?

  Posts don't propagate, you need to refresh to see new posts.
    Broadcast when we post to all peers we know about.

  3. Posting is slow because too long to render
  2. Can't follow people
  4. Can't like or reply to posts

user
    posts
    media
    tombstones
    following
    profile
        name
        description
        profile pic


Restruucture the app around the data. App/WS split is messy. Clean it up.

*/

import { App } from "App";


window.addEventListener('scroll', () => {
  // Total height of the document
  const totalPageHeight = document.body.scrollHeight;

  // Current scroll position
  const scrollPoint = window.scrollY + window.innerHeight;

  // Check if scrolled to bottom
  if (scrollPoint >= totalPageHeight) {
    // console.log.apply(null, log('Scrolled to the bottom!'));
    // console.log.apply(null, log(scrollPoint, totalPageHeight));
  }

});

let app = new App();

window.addEventListener("load", app.main.bind(app));
