Use request type directly from the library that provides this param

This commit is contained in:
Johannes Klein
2025-10-08 14:23:53 +02:00
parent c4a78e09e7
commit 686cca6022

View File

@@ -12,6 +12,7 @@ import React, { useEffect, useState } from "react";
import { Linking } from "react-native";
import { EventRegister } from "react-native-event-listeners";
import WebView from "react-native-webview";
import type { ShouldStartLoadRequest } from "react-native-webview/lib/WebViewTypes";
import { log } from "sharedHelpers/logger";
import { composeEmail } from "sharedHelpers/mail";
import { useFontScale } from "sharedHooks";
@@ -71,15 +72,8 @@ type WebViewSource = {
}
}
type WebViewRequest = {
url: string;
navigationType?: "click" | "other";
mainDocumentURL?: string | null;
isTopFrame?: boolean;
}
export function onShouldStartLoadWithRequest(
request: WebViewRequest,
request: ShouldStartLoadRequest,
source: WebViewSource,
params: FullPageWebViewParams,
setSource?: ( source: WebViewSource ) => void
@@ -241,7 +235,7 @@ const FullPageWebView = ( ) => {
className="h-full w-full flex-1"
source={source}
onShouldStartLoadWithRequest={
( request: WebViewRequest ) => onShouldStartLoadWithRequest(
request => onShouldStartLoadWithRequest(
request,
source,
params,