mobile: fix loading data in share extension

This commit is contained in:
Ammar Ahmed
2025-11-27 14:09:42 +05:00
parent 6b171f578d
commit a29bcf713f

View File

@@ -251,6 +251,7 @@ const ShareView = () => {
setRawData(item);
if (isURL(item.value)) {
note = await showLinkPreview(note, item.value);
noteTitle.current = note.title;
} else {
note.content.data = makeHtmlFromPlainText(item.value);
}
@@ -261,9 +262,6 @@ const ShareView = () => {
if (key.includes("TITLE") || key.includes("SUBJECT")) {
note.title = item[key];
noteTitle.current = note.title;
inputRef.current?.setNativeProps?.({
text: noteTitle.current
});
}
if (key.includes("TEXT") && !note.content.data) {
note.content.data = item[key];
@@ -294,6 +292,10 @@ const ShareView = () => {
}
}
}
inputRef.current?.setNativeProps?.({
text: noteTitle.current
});
onLoad();
setNote({ ...note });
} catch (e) {
@@ -308,7 +310,6 @@ const ShareView = () => {
try {
await initDatabase();
setLoadingExtension(false);
loadData(false);
useShareStore.getState().restore();
} catch (e) {
DatabaseLogger.error(e);