Skip to content

Commit b2b3c1b

Browse files
committed
refactor: Pass ts in cozy-external-bridge
1 parent 6b4acb7 commit b2b3c1b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: packages/cozy-external-bridge/src/container/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const extractUrl = (url: string): string => {
1010
export const handleRequestParentOrigin = (
1111
event: MessageEvent,
1212
origin: string
13-
) => {
13+
): void => {
1414
// We do not care about message from other origin that our iframe
1515
if (event.origin !== origin) {
1616
return

Diff for: packages/cozy-external-bridge/src/container/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ const useInitialRedirection = (): void => {
5353
}
5454

5555
// Allow the iframe to request the origin of the parent window
56-
const useParentOrigin = (origin: string) => {
56+
const useParentOrigin = (origin: string): void => {
5757
const client = useClient()
5858

5959
useEffect(() => {
6060
if (!client) return
6161

62-
const requestParentOriginHandler = (event: MessageEvent) =>
62+
const requestParentOriginHandler = (event: MessageEvent): void =>
6363
handleRequestParentOrigin(event, origin)
6464

6565
window.addEventListener('message', requestParentOriginHandler)

Diff for: packages/cozy-external-bridge/src/embedded/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const requestParentOrigin = (): Promise<string | undefined> => {
6666
return resolve(undefined)
6767
}
6868

69-
const handleMessage = (event: any) => {
69+
const handleMessage = (event: MessageEvent): void => {
7070
if (event.data === 'answerParentOrigin') {
7171
clearTimeout(timeout)
7272
window.removeEventListener('message', handleMessage)

0 commit comments

Comments
 (0)