Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions harmony/rn_webview/src/main/ets/RNCWebView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export struct RNCWebView {
}

let lockIdentifier = this.webViewBaseOperate?.getLockIdentifier()
let webViewTurboModule = this.ctx.rnInstance.getUITurboModule<WebViewTurboModule>(TM.RNCWebViewModule.NAME)
let webViewTurboModule = this.ctx.rnInstance.getTurboModule<WebViewTurboModule>(TM.RNCWebViewModule.NAME)
this.callLoadTimer = setTimeout(()=>{
Logger.debug(TAG, "call setTimeout")
webViewTurboModule.callLoadFunction(lockIdentifier)
Expand Down Expand Up @@ -402,7 +402,7 @@ export struct RNCWebView {

resetIntercept() {
Logger.debug(TAG,"resetIntercept")
this.ctx.rnInstance.getUITurboModule<WebViewTurboModule>(TM.RNCWebViewModule.NAME)
this.ctx.rnInstance.getTurboModule<WebViewTurboModule>(TM.RNCWebViewModule.NAME)
.clearLoadFunction(this.webViewBaseOperate?.getLockIdentifier())
clearTimeout(this.callLoadTimer)
this.shouldInterceptLoad = true
Expand Down
10 changes: 5 additions & 5 deletions harmony/rn_webview/src/main/ets/RNCWebViewPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import type {
DescriptorWrapperFactoryByDescriptorType,
DescriptorWrapperFactoryByDescriptorTypeCtx,
} from '@rnoh/react-native-openharmony/ts';
import { RNPackage, UITurboModuleFactory, UITurboModule } from '@rnoh/react-native-openharmony/ts';
import { RNPackage, TurboModulesFactory, TurboModule } from '@rnoh/react-native-openharmony/ts';
import { RNC, TM } from '@rnoh/react-native-openharmony/generated/ts';
import { WebViewTurboModule } from './WebViewTurboModule'
import { UITurboModuleContext } from '@rnoh/react-native-openharmony/src/main/ets/RNOH/RNOHContext';
import { TurboModuleContext } from '@rnoh/react-native-openharmony/src/main/ets/RNOH/RNOHContext';

export class RNCWebViewPackage extends RNPackage {
createDescriptorWrapperFactoryByDescriptorType(ctx: DescriptorWrapperFactoryByDescriptorTypeCtx): DescriptorWrapperFactoryByDescriptorType {
Expand All @@ -38,13 +38,13 @@ export class RNCWebViewPackage extends RNPackage {
}
}

createUITurboModuleFactory(ctx: UITurboModuleContext): UITurboModuleFactory {
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
return new WebViewTurboModulesFactory(ctx);
}
}

class WebViewTurboModulesFactory extends UITurboModuleFactory {
createTurboModule(name: string): UITurboModule | null {
class WebViewTurboModulesFactory extends TurboModulesFactory {
createTurboModule(name: string): TurboModule | null {
if (name === TM.RNCWebViewModule.NAME) {
return new WebViewTurboModule(this.ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions harmony/rn_webview/src/main/ets/WebViewTurboModule.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { UITurboModule } from '@rnoh/react-native-openharmony/ts';
import { TurboModule } from '@rnoh/react-native-openharmony/ts';
import { TM } from '@rnoh/react-native-openharmony/generated/ts';
import Logger from './Logger';

const TAG = "WebViewTurboModule"

export class WebViewTurboModule extends UITurboModule implements TM.RNCWebViewModule.Spec {
export class WebViewTurboModule extends TurboModule implements TM.RNCWebViewModule.Spec {
private loadCallbackMap : Map<number,()=> void> = new Map();

isFileUploadSupported(): Promise<boolean> {
Expand Down