Re-write voice context. Working towards #21

This commit is contained in:
Paul
2021-08-07 16:15:55 +01:00
parent 3bd6ab1388
commit 0e7e719308
7 changed files with 195 additions and 325 deletions

View File

@@ -12,8 +12,8 @@ import { Text } from "preact-i18n";
import { useContext } from "preact/hooks";
import { stopPropagation } from "../../lib/stopPropagation";
import { voiceState } from "../../lib/vortex/VoiceState";
import { VoiceOperationsContext } from "../../context/Voice";
import { useIntermediate } from "../../context/intermediate/Intermediate";
import UserIcon from "../../components/common/user/UserIcon";
@@ -29,7 +29,6 @@ interface Props {
export const Friend = observer(({ user }: Props) => {
const history = useHistory();
const { openScreen } = useIntermediate();
const { connect } = useContext(VoiceOperationsContext);
const actions: Children[] = [];
let subtext: Children = null;
@@ -46,7 +45,7 @@ export const Friend = observer(({ user }: Props) => {
ev,
user
.openDM()
.then(connect)
.then(voiceState.connect)
.then((x) => history.push(`/channel/${x._id}`)),
)
}>