Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/PersonalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,16 @@ export default {
if (!this.pickerSessionId) {
return
}

// Save the picker session ID to throw out the response if it changed since the request was made
// There's a race condition if onImportPhotos resolved in the meantime
const pickerSessionIdOfRequest = this.pickerSessionId

const url = generateUrl('/apps/integration_google/picker-session')
axios.get(url, { params: { sessionId: this.pickerSessionId } })
.then((response) => {
if (response.data.mediaItemsSet === true && !this.startingPhotoImport) {
// Check pickerSessionId again to fix race condition (could have changed in the meantime)
if (response.data.mediaItemsSet === true && !this.startingPhotoImport && (pickerSessionIdOfRequest === this.pickerSessionId)) {
this.onImportPhotos()
}
})
Expand Down
Loading