refactor: replace funAnimalName with getPeerName in useRoom

This commit is contained in:
Jeremy Kahn 2022-11-26 09:25:14 -06:00
parent d4d4f05e44
commit 2910c70a8a

View File

@ -2,7 +2,6 @@ import { useContext, useEffect, useMemo, useState } from 'react'
import { BaseRoomConfig } from 'trystero' import { BaseRoomConfig } from 'trystero'
import { TorrentRoomConfig } from 'trystero/torrent' import { TorrentRoomConfig } from 'trystero/torrent'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import { funAnimalName } from 'fun-animal-names'
import { ShellContext } from 'contexts/ShellContext' import { ShellContext } from 'contexts/ShellContext'
import { SettingsContext } from 'contexts/SettingsContext' import { SettingsContext } from 'contexts/SettingsContext'
@ -224,7 +223,7 @@ export function useRoom(
const peerExist = peerIndex !== -1 const peerExist = peerIndex !== -1
showAlert( showAlert(
`${ `${
peerExist ? funAnimalName(peerList[peerIndex].userId) : 'Someone' peerExist ? getPeerName(peerList[peerIndex].userId) : 'Someone'
} has left the room`, } has left the room`,
{ {
severity: 'warning', severity: 'warning',