1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Mobile: Resolves #9134: Image editor: Allow loading from save when the image editor is reloaded in the background (#9135)

This commit is contained in:
Henry Heino 2023-10-31 07:57:26 -07:00 committed by GitHub
parent b8c26b2ef3
commit 86b00d0a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -16,11 +16,13 @@ const logger = Logger.create('ImageEditor');
type OnSaveCallback = (svgData: string)=> void;
type OnCancelCallback = ()=> void;
// Returns the empty string to load from a template.
type LoadInitialSVGCallback = ()=> Promise<string>;
interface Props {
themeId: number;
loadInitialSVGData: LoadInitialSVGCallback|null;
loadInitialSVGData: LoadInitialSVGCallback;
onSave: OnSaveCallback;
onExit: OnCancelCallback;
}

View File

@ -815,12 +815,7 @@ class NoteScreenComponent extends BaseScreenComponent {
private drawPicture_onPress = async () => {
// Create a new empty drawing and attach it now.
const resource = await this.attachNewDrawing('');
this.setState({
showImageEditor: true,
loadImageEditorData: null,
imageEditorResource: resource,
});
await this.editDrawing(resource);
};
private async updateDrawing(svgData: string) {