Skip to content

Commit 3a578ed

Browse files
committed
feat: add image preloading
1 parent 4b6656d commit 3a578ed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/app/pages/tasks/task-playables/face-name-association/face-name-association.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,19 @@ export class FaceNameAssociationComponent extends AbstractBaseTaskComponent {
150150
// store in cache for next block
151151
this.config.setCacheValue(FaceNameAssociationCache.STIMULI, this.stimuli);
152152
}
153+
154+
this.stimuli.forEach((stimulus) => {
155+
this.preload(stimulus.imagePath);
156+
});
157+
153158
super.start();
154159
}
155160

161+
private preload(url: string) {
162+
const img = new Image();
163+
img.src = url;
164+
}
165+
156166
private getActualAnswer(stimulus: FaceNameAssociationStimulus): UserResponse {
157167
if (this.phase === 'learning-phase') {
158168
return UserResponse.NA;

0 commit comments

Comments
 (0)