Split state into temp and saved

Also stop using IPC to calculate window width

Add default torrents--the Blender Foundation videos--not displayed yet
This commit is contained in:
DC
2016-03-05 15:44:57 -08:00
parent c2b5f7a7bb
commit 5b383d3ed0
9 changed files with 618 additions and 72 deletions

View File

@@ -6,18 +6,18 @@ var hx = hyperx(h)
var prettyBytes = require('pretty-bytes')
function TorrentList (state, dispatch) {
var torrents = state.view.client
? state.view.client.torrents
var torrents = state.temp.client
? state.temp.client.torrents
: []
var list = torrents.map((torrent) => renderTorrent(state, dispatch, torrent))
var list = torrents.map((torrent) => renderTorrent(torrent, dispatch))
return hx`<div class="torrent-list">${list}</div>`
}
// Renders a torrent in the torrent list
// Includes name, download status, play button, background image
// May be expanded for additional info, including the list of files inside
function renderTorrent (state, dispatch, torrent) {
function renderTorrent (torrent, dispatch) {
// Background image: show some nice visuals, like a frame from the movie, if possible
var style = {}
if (torrent.posterURL) {