You've already forked joplin
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:
@ -468,9 +468,9 @@ export default class Note extends BaseItem {
|
||||
return this.modelSelectAll('SELECT * FROM notes WHERE is_conflict = 0');
|
||||
}
|
||||
|
||||
public static async updateGeolocation(noteId: string): Promise<void> {
|
||||
if (!Setting.value('trackLocation')) return;
|
||||
if (!Note.updateGeolocationEnabled_) return;
|
||||
public static async updateGeolocation(noteId: string): Promise<NoteEntity | null> {
|
||||
if (!Setting.value('trackLocation')) return null;
|
||||
if (!Note.updateGeolocationEnabled_) return null;
|
||||
|
||||
const startWait = time.unixMs();
|
||||
while (true) {
|
||||
@ -479,7 +479,7 @@ export default class Note extends BaseItem {
|
||||
await time.sleep(1);
|
||||
if (startWait + 1000 * 20 < time.unixMs()) {
|
||||
this.logger().warn(`Failed to update geolocation for: timeout: ${noteId}`);
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -499,7 +499,7 @@ export default class Note extends BaseItem {
|
||||
|
||||
this.geolocationUpdating_ = false;
|
||||
|
||||
if (!geoData) return;
|
||||
if (!geoData) return null;
|
||||
|
||||
this.logger().info('Got lat/long');
|
||||
this.geolocationCache_ = geoData;
|
||||
@ -508,12 +508,14 @@ export default class Note extends BaseItem {
|
||||
this.logger().info(`Updating lat/long of note ${noteId}`);
|
||||
|
||||
const note = await Note.load(noteId);
|
||||
if (!note) return; // Race condition - note has been deleted in the meantime
|
||||
if (!note) return null; // Race condition - note has been deleted in the meantime
|
||||
|
||||
note.longitude = geoData.coords.longitude;
|
||||
note.latitude = geoData.coords.latitude;
|
||||
note.altitude = geoData.coords.altitude;
|
||||
await Note.save(note, { ignoreProvisionalFlag: true });
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
static filter(note: NoteEntity) {
|
||||
|
Reference in New Issue
Block a user