Skip to content

Commit

Permalink
Mobile: Fix manual resource download mode (#10748)
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator authored Jul 16, 2024
1 parent e49bca8 commit 64e4ebb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

import WebViewToRNMessenger from '../../../utils/ipc/WebViewToRNMessenger';
import { NoteViewerLocalApi, NoteViewerRemoteApi, RendererWebViewOptions } from './types';
import { NoteViewerLocalApi, NoteViewerRemoteApi, RendererWebViewOptions, WebViewLib } from './types';
import Renderer from './Renderer';

declare global {
interface Window {
rendererWebViewOptions: RendererWebViewOptions;
webviewLib: WebViewLib;
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
declare const webviewLib: any;
declare const webviewLib: WebViewLib;

const messenger = new WebViewToRNMessenger<NoteViewerLocalApi, NoteViewerRemoteApi>(
'note-viewer',
Expand All @@ -33,6 +34,8 @@ webviewLib.initialize({
},
});

window.webviewLib = webviewLib;

const renderer = new Renderer({
...window.rendererWebViewOptions,
fsDriver: messenger.remoteApi.fsDriver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ export interface NoteViewerRemoteApi {
onPostPluginMessage(contentScriptId: string, message: any): Promise<any>;
fsDriver: RendererFsDriver;
}

export interface WebViewLib {
initialize(config: unknown): void;
}

1 comment on commit 64e4ebb

@gerroon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this merged? I still can't download images on IOS 18.0.1 using Joplin 13.0.7 Thanks

Please sign in to comment.