cleanup | distraction free with all toasts
This commit is contained in:
@@ -251,14 +251,12 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (findExistingConversation) {
|
if (findExistingConversation) {
|
||||||
enqueueSnackbar('quick dialed someone!', { variant: 'success' });
|
|
||||||
setSelectedConversationId(findExistingConversation.id);
|
setSelectedConversationId(findExistingConversation.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create conversation in this case
|
// create conversation in this case
|
||||||
const newConversationId = await createOneOnOneConversation(otherUser, nirvanaUser);
|
const newConversationId = await createOneOnOneConversation(otherUser, nirvanaUser);
|
||||||
enqueueSnackbar('started conversation!', { variant: 'success' });
|
|
||||||
setSelectedConversationId(newConversationId);
|
setSelectedConversationId(newConversationId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
enqueueSnackbar('Something went wrong, please try again', { variant: 'error' });
|
enqueueSnackbar('Something went wrong, please try again', { variant: 'error' });
|
||||||
@@ -313,8 +311,6 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
|||||||
audioChunks[0].type,
|
audioChunks[0].type,
|
||||||
);
|
);
|
||||||
await sendContentBlockToConversation(contentBlock, selectedConversation.id);
|
await sendContentBlockToConversation(contentBlock, selectedConversation.id);
|
||||||
|
|
||||||
enqueueSnackbar('clip sent!', { variant: 'success' });
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
enqueueSnackbar('Problem in recording clip', { variant: 'error' });
|
enqueueSnackbar('Problem in recording clip', { variant: 'error' });
|
||||||
@@ -383,7 +379,6 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
enqueueSnackbar('started recording');
|
|
||||||
setIsCloudDoingMagic(true);
|
setIsCloudDoingMagic(true);
|
||||||
mediaRecorder.start();
|
mediaRecorder.start();
|
||||||
setIsUserSpeaking(true);
|
setIsUserSpeaking(true);
|
||||||
@@ -406,14 +401,13 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
|||||||
const handleStopBroadcast = useCallback(() => {
|
const handleStopBroadcast = useCallback(() => {
|
||||||
if (isUserSpeaking) {
|
if (isUserSpeaking) {
|
||||||
setIsUserSpeaking(false);
|
setIsUserSpeaking(false);
|
||||||
enqueueSnackbar('stopped...', { variant: 'info' });
|
|
||||||
|
|
||||||
// actually stop talking after 2 seconds to capture everything
|
// actually stop talking after 2 seconds to capture everything
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
mediaRecorder.stop();
|
mediaRecorder.stop();
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
}, [setIsUserSpeaking, isUserSpeaking, mediaRecorder, enqueueSnackbar]);
|
}, [setIsUserSpeaking, isUserSpeaking, mediaRecorder]);
|
||||||
|
|
||||||
useKeyPressEvent('`', handleBroadcast, handleStopBroadcast);
|
useKeyPressEvent('`', handleBroadcast, handleStopBroadcast);
|
||||||
|
|
||||||
@@ -486,7 +480,6 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
|
|||||||
nirvanaUser,
|
nirvanaUser,
|
||||||
conversationName ?? null,
|
conversationName ?? null,
|
||||||
);
|
);
|
||||||
enqueueSnackbar('started group conversation!', { variant: 'success' });
|
|
||||||
setSelectedConversationId(newConversationId);
|
setSelectedConversationId(newConversationId);
|
||||||
|
|
||||||
setCreateConversationMode(false);
|
setCreateConversationMode(false);
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
import { Credentials } from 'google-auth-library/build/src/auth/credentials';
|
|
||||||
import { Button, Container } from '@mui/material';
|
import { Button, Container } from '@mui/material';
|
||||||
import React, { useContext, useEffect, useCallback, useState } from 'react';
|
|
||||||
|
|
||||||
import { FcGoogle } from 'react-icons/fc';
|
|
||||||
import { blueGrey } from '@mui/material/colors';
|
|
||||||
import Channels from '../electron/constants';
|
|
||||||
import { firebaseAuth } from '../firebase/connect';
|
|
||||||
import {
|
import {
|
||||||
GoogleAuthProvider,
|
|
||||||
signInWithCredential,
|
|
||||||
setPersistence,
|
|
||||||
browserLocalPersistence,
|
|
||||||
User as FirebaseUser,
|
User as FirebaseUser,
|
||||||
onAuthStateChanged,
|
GoogleAuthProvider,
|
||||||
updateCurrentUser,
|
browserLocalPersistence,
|
||||||
getAuth,
|
getAuth,
|
||||||
|
onAuthStateChanged,
|
||||||
|
setPersistence,
|
||||||
|
signInWithCredential,
|
||||||
|
updateCurrentUser,
|
||||||
} from 'firebase/auth';
|
} from 'firebase/auth';
|
||||||
import { useSnackbar } from 'notistack';
|
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
||||||
import { createUser, getUserById } from '../firebase/firestore';
|
import { createUser, getUserById } from '../firebase/firestore';
|
||||||
|
|
||||||
|
import Channels from '../electron/constants';
|
||||||
import CircularProgress from '@mui/material/CircularProgress';
|
import CircularProgress from '@mui/material/CircularProgress';
|
||||||
|
import { Credentials } from 'google-auth-library/build/src/auth/credentials';
|
||||||
|
import { FcGoogle } from 'react-icons/fc';
|
||||||
import NirvanaLogo from '../components/NirvanaLogo';
|
import NirvanaLogo from '../components/NirvanaLogo';
|
||||||
import { User } from '@nirvana/core/src/models/user.model';
|
import { User } from '@nirvana/core/src/models/user.model';
|
||||||
|
import { blueGrey } from '@mui/material/colors';
|
||||||
|
import { firebaseAuth } from '../firebase/connect';
|
||||||
|
import { useSnackbar } from 'notistack';
|
||||||
|
|
||||||
interface IAuthContext {
|
interface IAuthContext {
|
||||||
user?: FirebaseUser;
|
user?: FirebaseUser;
|
||||||
@@ -93,7 +92,6 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
|
|||||||
const user = result.user;
|
const user = result.user;
|
||||||
console.log(user);
|
console.log(user);
|
||||||
updateCurrentUser(firebaseAuth, user);
|
updateCurrentUser(firebaseAuth, user);
|
||||||
enqueueSnackbar('Signed in! All set!', { variant: 'success' });
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { ErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
|
import React from 'react';
|
||||||
import { useSnackbar } from 'notistack';
|
import { useSnackbar } from 'notistack';
|
||||||
|
|
||||||
function MyFallbackComponent({
|
function MyFallbackComponent({
|
||||||
|
|||||||
Reference in New Issue
Block a user