Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optimistic file upload #717

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
chore: add comment
  • Loading branch information
akuokojnr committed Apr 26, 2021
commit 40b44ff482cac9a48622de890d21e60f48cb34aa
3 changes: 2 additions & 1 deletion components/core/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export default class ApplicationPage extends React.Component {
}

if (newViewerState.library?.length) {
// NOTE(daniel): update optimistic files with upload data
let oldViewerState = this.state.viewer;
let oldLibrary = oldViewerState.library;

Expand Down Expand Up @@ -380,7 +381,7 @@ export default class ApplicationPage extends React.Component {
}

files = await this._handleOptimisticUpload({ files });
return;

const resolvedFiles = [];
for (let i = 0; i < files.length; i++) {
if (Store.checkCancelled(`${files[i].lastModified}-${files[i].name}`)) {
Expand Down