2023-11-09 09:44:04 +00:00
|
|
|
const m = require('mithril')
|
|
|
|
const Authentication = require('./authentication')
|
|
|
|
const videos = require('./videos')
|
|
|
|
|
|
|
|
const Browse = {
|
|
|
|
oninit: function(vnode) {
|
2023-11-14 07:27:04 +00:00
|
|
|
Authentication.requiresLogin()
|
2023-11-09 09:44:04 +00:00
|
|
|
if (!videos.Tree.length) {
|
|
|
|
this.refreshTree()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
refreshTree: function(vnode) {
|
|
|
|
videos.refreshTree()
|
|
|
|
},
|
|
|
|
|
|
|
|
view: function(vnode) {
|
|
|
|
return [
|
|
|
|
videos.error
|
|
|
|
? m('div.full-error', { onclick: this.refreshTree.bind(this) }, [
|
|
|
|
videos.error, m('br'), 'Click here to try again'
|
|
|
|
])
|
|
|
|
: null,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Browse
|