nfp_sites/filadelfia_web/app/page_browse.js

29 lines
588 B
JavaScript
Raw Normal View History

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