You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
@ -200,8 +200,7 @@ shared.initState = async function(comp) {
|
||||
const note = await Note.load(comp.props.noteId);
|
||||
let mode = 'view';
|
||||
|
||||
if (isProvisionalNote) {
|
||||
// note = comp.props.itemType == 'todo' ? Note.newTodo(comp.props.folderId) : Note.new(comp.props.folderId);
|
||||
if (isProvisionalNote && !comp.props.sharedData) {
|
||||
mode = 'edit';
|
||||
comp.scheduleFocusUpdate();
|
||||
}
|
||||
@ -218,8 +217,25 @@ shared.initState = async function(comp) {
|
||||
noteResources: await shared.attachedResources(note ? note.body : ''),
|
||||
});
|
||||
|
||||
|
||||
if (comp.props.sharedData) {
|
||||
this.noteComponent_change(comp, 'body', comp.props.sharedData.value);
|
||||
if (comp.props.sharedData.title) {
|
||||
this.noteComponent_change(comp, 'title', comp.props.sharedData.title);
|
||||
}
|
||||
if (comp.props.sharedData.text) {
|
||||
this.noteComponent_change(comp, 'body', comp.props.sharedData.text);
|
||||
}
|
||||
if (comp.props.sharedData.resources) {
|
||||
for (let i = 0; i < comp.props.sharedData.resources.length; i++) {
|
||||
const resource = comp.props.sharedData.resources[i];
|
||||
reg.logger().info(`about to attach resource ${JSON.stringify(resource)}`);
|
||||
await comp.attachFile({
|
||||
uri: resource.uri,
|
||||
type: resource.mimeType,
|
||||
fileName: resource.name,
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
|
Reference in New Issue
Block a user