diff --git a/app/controller.js b/app/controller.js index 897679e0..f0d9dd4d 100644 --- a/app/controller.js +++ b/app/controller.js @@ -40,8 +40,6 @@ export default function(state, emitter) { checkFiles(); }); - emitter.on('navigate', checkFiles); - emitter.on('render', () => { lastRender = Date.now(); }); @@ -174,6 +172,7 @@ export default function(state, emitter) { emitter.emit('pushState', '/error'); } } finally { + await state.user.syncFileList(); openLinksInNewTab(links, false); state.archive = null; state.password = ''; @@ -265,8 +264,7 @@ export default function(state, emitter) { }); setInterval(() => { - // poll for updates of the download counts - // TODO something for the share page: || state.route === '/share/:id' + // poll for updates of the upload list if (state.route === '/') { checkFiles(); } diff --git a/app/routes.js b/app/routes.js index 6c64cae8..6abd558e 100644 --- a/app/routes.js +++ b/app/routes.js @@ -13,6 +13,7 @@ module.exports = function(app = choo()) { app.route('/oauth', async function(state, emit) { try { await state.user.finishLogin(state.query.code, state.query.state); + await state.user.syncFileList(); emit('replaceState', '/'); } catch (e) { emit('replaceState', '/error');