Skip to content

Commit ad23873

Browse files
committed
fix: Typing
1 parent 718f27e commit ad23873

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
3636
const [isInsideCozy, setIsInsideCozy] = useState(false);
3737
useEffect(() => {
3838
// @ts-expect-error cozyBridge is injected by Cozy platform
39+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
3940
window._cozyBridge.requestParentOrigin().then((origin) => {
4041
setIsInsideCozy(Boolean(origin));
4142
});

src/frontend/apps/impress/src/layouts/MainLayout.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import { useRouter } from 'next/router';
12
import { PropsWithChildren, useEffect, useState } from 'react';
23
import { css } from 'styled-components';
34

45
import { Box } from '@/components';
56
import { useCunninghamTheme } from '@/cunningham';
7+
import { useCreateDoc } from '@/features/docs';
68
import { Header } from '@/features/header';
79
import { HEADER_HEIGHT } from '@/features/header/conf';
810
import { LeftPanel } from '@/features/left-panel';
911
import { MAIN_LAYOUT_ID } from '@/layouts/conf';
1012
import { useResponsiveStore } from '@/stores';
11-
import { useCreateDoc } from '@/features/docs';
12-
import { useRouter } from 'next/router';
1313

1414
type MainLayoutProps = {
1515
backgroundColor?: 'white' | 'grey';
@@ -28,6 +28,7 @@ export function MainLayout({
2828
const [isInsideCozy, setIsInsideCozy] = useState(false);
2929
useEffect(() => {
3030
// @ts-expect-error cozyBridge is injected by Cozy platform
31+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
3132
window._cozyBridge.requestParentOrigin().then((origin) => {
3233
setIsInsideCozy(Boolean(origin));
3334
if (Boolean(origin)) {
@@ -39,24 +40,29 @@ export function MainLayout({
3940
const hasContent = !isInsideCozy;
4041
const shouldShowLeftPanel = !isInsideCozy;
4142

43+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4244
const { mutate: createDoc, isPending: isCreatingDoc } = useCreateDoc({
4345
onSuccess: (doc) => {
46+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
4447
router.push(`/docs/${doc.id}`);
4548
},
4649
});
4750

4851
useEffect(() => {
4952
window.onmessage = function (e) {
50-
if (e.data == undefined || e.data == null || typeof e.data !== 'string')
53+
if (e.data == undefined || e.data == null || typeof e.data !== 'string') {
5154
return;
55+
}
5256
if (e.data.startsWith('newDoc')) {
5357
createDoc();
5458
}
5559
if (e.data.startsWith('openFile:')) {
5660
const fileId = e.data.split('openFile:')[1].trim();
61+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
5762
router.push(`/docs/${fileId}`);
5863
}
5964
};
65+
// eslint-disable-next-line react-hooks/exhaustive-deps
6066
}, []);
6167

6268
return (

0 commit comments

Comments
 (0)