Skip to content

Commit

Permalink
feat(client): shuffle results
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Oct 9, 2023
1 parent a1a4a4e commit 3a60174
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/presentation/screens/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const viewportHeight = ref(window.innerHeight)
* Hook called before search
*/
function onBeforeSearch(): void {
result.value = []

requestAnimationFrame(() => {
isLoading.value = true
isSearchFinished.value = false
Expand Down Expand Up @@ -98,8 +100,10 @@ function search(): void {
setTimeout(() => {
onAfterSearch()

const hotelsShuffled = hotels.sort(() => Math.random() - 0.5)

setTimeout(() => {
hotels.forEach((hotel, i) => {
hotelsShuffled.forEach((hotel, i) => {
result.value.push(hotel)
})
}, 150)
Expand Down

0 comments on commit 3a60174

Please sign in to comment.