Skip to content

Commit ce8db6c

Browse files
Improves code comment to more accurately explain the intent
1 parent 95496f0 commit ce8db6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ghost/admin/app/services/unsplash.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export default Service.extend({
118118
}).restartable(),
119119

120120
_addPhotosFromResponse(response, searchTermAtRequest) {
121-
// If this is a search result, only apply it if the search term still matches
122-
// This prevents race conditions where old search results overwrite new ones
121+
// If a search term was provided at the time of the request,
122+
// we only want to add photos if the search term matches the current one.
123123
if (searchTermAtRequest && searchTermAtRequest !== this.searchTerm) {
124124
return;
125125
}

0 commit comments

Comments
 (0)