Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

chore: cleanup code

httpjamesm7b2edf3f07a1
diff --git a/apps/cast/src/pages/slideshow.tsx b/apps/cast/src/pages/slideshow.tsx
index 755a603ad6..a7f32e8172 100644
--- a/apps/cast/src/pages/slideshow.tsx
+++ b/apps/cast/src/pages/slideshow.tsx
@@ -7,7 +7,6 @@ import { getCollection } from 'services/collectionService';
import { syncFiles } from 'services/fileService';
import { EnteFile } from 'types/file';
import { downloadFileAsBlob, isRawFileFromFileName } from 'utils/file';
-import { useCastReceiver } from '@ente/shared/hooks/useCastReceiver';
export const SlideshowContext = createContext<{
showNextSlide: () => void;
@@ -27,8 +26,6 @@ export default function Slideshow() {
Record<string, string>
>({});
- const { cast } = useCastReceiver();
-
const init = async () => {
try {
// get requested collection id from localStorage
@@ -80,9 +77,8 @@ export default function Slideshow() {
const router = useRouter();
useEffect(() => {
- if (!cast) return;
init();
- }, [cast]);
+ }, []);
useEffect(() => {
if (collectionFiles.length < 1) return;
diff --git a/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx b/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx
index 58cb55b8df..a17774de84 100644
--- a/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx
+++ b/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx
@@ -1,4 +1,4 @@
-import { Button, Typography } from '@mui/material';
+import { Typography } from '@mui/material';
import DialogBoxV2 from '@ente/shared/components/DialogBoxV2';
import SingleInputForm, {
SingleInputFormProps,
@@ -12,6 +12,7 @@ import { useEffect, useState } from 'react';
import EnteButton from '@ente/shared/components/EnteButton';
import EnteSpinner from '@ente/shared/components/EnteSpinner';
import { VerticallyCentered } from '@ente/shared/components/Container';
+import { logError } from '@ente/shared/sentry';
interface Props {
show: boolean;
@@ -87,7 +88,8 @@ export default function AlbumCastDialog(props: Props) {
try {
await instance.requestSession();
} catch (e) {
- console.log('Error requesting session:', e);
+ setView('auto-cast-error');
+ logError(e, 'Error requesting session');
return;
}
const session = instance.getCurrentSession();
@@ -107,20 +109,19 @@ export default function AlbumCastDialog(props: Props) {
})
.catch((e) => {
setView('auto-cast-error');
- console.error(e);
+ logError(e, 'Error casting to TV');
});
}
}
);
- console.log('sending message');
session
.sendMessage('urn:x-cast:pair-request', {})
.then(() => {
console.log('Message sent successfully');
})
.catch((error) => {
- console.log('Error sending message:', error);
+ logError(error, 'Error sending message');
});
});
}
@@ -136,21 +137,21 @@ export default function AlbumCastDialog(props: Props) {
}}>
{view === 'choose' && (
<>
- <Button
+ <EnteButton
onClick={() => {
setView('auto');
}}>
{t('AUTO_CAST_PAIR')}
- </Button>
+ </EnteButton>
<Typography color={'text.muted'}>
{t('AUTO_CAST_PAIR_REQUIRES_CONNECTION_TO_GOOGLE')}
</Typography>
- <Button
+ <EnteButton
onClick={() => {
setView('pin');
}}>
{t('PAIR_WITH_PIN')}
- </Button>
+ </EnteButton>
</>
)}
{view === 'auto' && (