1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Android: Fixes #7791: Fixed issue where app would close after sharing a file

This commit is contained in:
Laurent Cozic
2023-02-20 16:05:00 +00:00
parent f2995dd196
commit 25a31b0689
5 changed files with 53 additions and 28 deletions

View File

@ -120,27 +120,29 @@ shared.saveNoteButton_press = async function(comp: any, folderId: string = null,
comp.setState(newState);
if (isProvisionalNote) {
const geoNote: any = await Note.updateGeolocation(note.id);
const updateGeoloc = async () => {
const geoNote: NoteEntity = await Note.updateGeolocation(note.id);
// TODO: CHECK - this code has never worked??
const stateNote = comp.state.note;
if (!stateNote || !geoNote) return;
if (stateNote.id !== geoNote.id) return; // Another note has been loaded while geoloc was being retrieved
const stateNote = comp.state.note;
if (!stateNote || !geoNote) return;
if (stateNote.id !== geoNote.id) return; // Another note has been loaded while geoloc was being retrieved
// Geo-location for this note has been saved to the database however the properties
// are is not in the state so set them now.
// Geo-location for this note has been saved to the database however the properties
// are is not in the state so set them now.
const geoInfo = {
longitude: geoNote.longitude,
latitude: geoNote.latitude,
altitude: geoNote.altitude,
};
const geoInfo = {
longitude: geoNote.longitude,
latitude: geoNote.latitude,
altitude: geoNote.altitude,
const modNote = Object.assign({}, stateNote, geoInfo);
const modLastSavedNote = Object.assign({}, comp.state.lastSavedNote, geoInfo);
comp.setState({ note: modNote, lastSavedNote: modLastSavedNote });
};
const modNote = Object.assign({}, stateNote, geoInfo);
const modLastSavedNote = Object.assign({}, comp.state.lastSavedNote, geoInfo);
comp.setState({ note: modNote, lastSavedNote: modLastSavedNote });
await updateGeoloc();
}
releaseMutex();