Skip to content

Commit 77c67af

Browse files
committed
banned
1 parent 28cceca commit 77c67af

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

components/helper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ const randomElement = function (arrayList) {
44
return arrayList[Math.floor((Math.random() * arrayList.length))]
55
}
66

7+
const banned = ['zGuBURGGmdY', 'BI465ksrlWs', 'oJlt2XBWuWs', '6e6MhcxiEgA', 'vb-3qEe3rg8']
8+
9+
const removeBanned = (list) => list.filter(item => !banned.includes(item.id))
10+
711
export {
812
classNames,
9-
randomElement
13+
randomElement,
14+
removeBanned
1015
}

pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ReCAPTCHA from 'react-google-recaptcha'
88
import { FaAngleDoubleDown, FaAngleDoubleUp, FaGithub } from 'react-icons/fa'
99
import { createApi } from 'unsplash-js'
1010

11-
import { randomElement } from '@/components/helper'
11+
import { randomElement, removeBanned } from '@/components/helper'
1212
import {
1313
AlertRobotComponent,
1414
calendly,
@@ -171,7 +171,7 @@ export async function getStaticProps () {
171171
})
172172

173173
const randomE = (result.type === 'success')
174-
? randomElement(result.response.results).urls.full
174+
? randomElement(removeBanned(result.response.results))
175175
: ''
176176

177177
return {

0 commit comments

Comments
 (0)