fixed filelist sync on initial login and after upload
This commit is contained in:
parent
e58ebc835c
commit
09a4d7b9ee
@ -40,8 +40,6 @@ export default function(state, emitter) {
|
|||||||
checkFiles();
|
checkFiles();
|
||||||
});
|
});
|
||||||
|
|
||||||
emitter.on('navigate', checkFiles);
|
|
||||||
|
|
||||||
emitter.on('render', () => {
|
emitter.on('render', () => {
|
||||||
lastRender = Date.now();
|
lastRender = Date.now();
|
||||||
});
|
});
|
||||||
@ -174,6 +172,7 @@ export default function(state, emitter) {
|
|||||||
emitter.emit('pushState', '/error');
|
emitter.emit('pushState', '/error');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
await state.user.syncFileList();
|
||||||
openLinksInNewTab(links, false);
|
openLinksInNewTab(links, false);
|
||||||
state.archive = null;
|
state.archive = null;
|
||||||
state.password = '';
|
state.password = '';
|
||||||
@ -265,8 +264,7 @@ export default function(state, emitter) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
// poll for updates of the download counts
|
// poll for updates of the upload list
|
||||||
// TODO something for the share page: || state.route === '/share/:id'
|
|
||||||
if (state.route === '/') {
|
if (state.route === '/') {
|
||||||
checkFiles();
|
checkFiles();
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ module.exports = function(app = choo()) {
|
|||||||
app.route('/oauth', async function(state, emit) {
|
app.route('/oauth', async function(state, emit) {
|
||||||
try {
|
try {
|
||||||
await state.user.finishLogin(state.query.code, state.query.state);
|
await state.user.finishLogin(state.query.code, state.query.state);
|
||||||
|
await state.user.syncFileList();
|
||||||
emit('replaceState', '/');
|
emit('replaceState', '/');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
emit('replaceState', '/error');
|
emit('replaceState', '/error');
|
||||||
|
Loading…
Reference in New Issue
Block a user