mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
handle safari cocoa core data timestamps (#8440)
This commit is contained in:
parent
c4e988f406
commit
de7d5e7c7e
@ -86,8 +86,13 @@ export const genericPositionFromGeolocation = (geoPosition: GeolocationPosition)
|
||||
const {
|
||||
latitude, longitude, altitude, accuracy,
|
||||
} = geoPosition.coords;
|
||||
|
||||
return {
|
||||
timestamp: geoPosition.timestamp,
|
||||
// safari reports geolocation timestamps as Apple Cocoa Core Data timestamp
|
||||
// or ms since 1/1/2001 instead of the regular epoch
|
||||
// they also use local time, not utc
|
||||
// to simplify, just use Date.now()
|
||||
timestamp: Date.now(),
|
||||
latitude, longitude, altitude, accuracy,
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user