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

Better handling of network errors and improved borders

This commit is contained in:
Laurent Cozic
2017-10-22 13:45:56 +01:00
parent 6e49aa45c0
commit 0ee82bd5ce
11 changed files with 223 additions and 56 deletions

View File

@ -259,11 +259,21 @@ class Note extends BaseItem {
geoData = Object.assign({}, this.geolocationCache_);
} else {
this.geolocationUpdating_ = true;
this.logger().info('Fetching geolocation...');
geoData = await shim.Geolocation.currentPosition();
try {
geoData = await shim.Geolocation.currentPosition();
} catch (error) {
this.logger().error('Could not get lat/long for note ' + noteId + ': ', error);
geoData = null;
}
this.geolocationUpdating_ = false;
if (!geoData) return;
this.logger().info('Got lat/long');
this.geolocationCache_ = geoData;
this.geolocationUpdating_ = false;
}
this.logger().info('Updating lat/long of note ' + noteId);