fix: use webview.current to check valid instance

This commit is contained in:
Ammar Ahmed
2022-06-13 10:57:09 +05:00
parent 4545b15595
commit 5ab91644b4

View File

@@ -17,7 +17,7 @@ export type Settings = {
};
async function call(webview: RefObject<WebView | undefined>, action?: Action) {
if (!webview || !action) return;
if (!webview.current || !action) return;
setImmediate(() => webview.current?.injectJavaScript(action.job));
let response = await getResponse(action.id);
console.log('webview job: ', action.id, response ? response.value : response);