mirror of
https://github.com/System-End/site.git
synced 2026-04-19 23:22:49 +00:00
Whitelist channel names
This commit is contained in:
parent
23a2b0abaa
commit
593c26c367
1 changed files with 3 additions and 1 deletions
|
|
@ -18,6 +18,8 @@ const Channel = ({ color, channel }) => (
|
|||
<Text as="strong" color={color} children={channel} />
|
||||
)
|
||||
|
||||
const whitelistedChannels = ["#lounge", "#ship", "#design", "#minecraft", "#hq", "#welcome", "#studycorner"]
|
||||
|
||||
export default ({ sx, ...props }) => {
|
||||
const didUnmount = useRef(false)
|
||||
const [events, setEvents] = useState([
|
||||
|
|
@ -41,7 +43,7 @@ export default ({ sx, ...props }) => {
|
|||
if (e) {
|
||||
try {
|
||||
e = JSON.parse(e)
|
||||
if (Object.keys(types).includes(e.type)) {
|
||||
if (Object.keys(types).includes(e.type) && whitelistedChannels.includes(e.channel)) {
|
||||
e.type = types[e.type]
|
||||
e.color = sample(colors)
|
||||
if (e.type === 'reaction') e.emoji = sample(emoji)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue