Skip to content

Commit 5127636

Browse files
committed
Fix cache response on main thread
1 parent 71769fc commit 5127636

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ExampleMVVM/Data/Repositories/DefaultMoviesRepository.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension DefaultMoviesRepository: MoviesRepository {
3131
cache.getResponse(for: requestDTO) { result in
3232

3333
if case let .success(responseDTO?) = result {
34-
cached(responseDTO.toDomain())
34+
DispatchQueue.main.async { cached(responseDTO.toDomain()) }
3535
}
3636
guard !task.isCancelled else { return }
3737

0 commit comments

Comments
 (0)