Creating a mechanism to store settings both in the database and in redux.
This commit is contained in:
1 parent
07edc22d31
commit
c0015a7cfa
10 files changed
+272
-18
No files matched your search
@@ -34,7 +34,11 @@ const backgroundGeolocationConfig = {
|
||||
distanceFilter: 10,
|
||||
};
|
||||
|
||||
export const startBackgroundGeolocation = async (newLocationHandler: any) => {
|
||||
export const startBackgroundGeolocation = async (
|
||||
newLocationHandler: any,
|
||||
distanceFilter: number
|
||||
) => {
|
||||
backgroundGeolocationConfig.distanceFilter = distanceFilter;
|
||||
const locationHandler = (location: any, error: any) => {
|
||||
console.log('com.dyomedea.dyomedea LOG', ' - Callback');
|
||||
if (error) {
|
||||
@@ -57,8 +61,8 @@ export const startBackgroundGeolocation = async (newLocationHandler: any) => {
|
||||
}
|
||||
console.log(location);
|
||||
if (location !== undefined) {
|
||||
newLocationHandler(location);
|
||||
}
|
||||
newLocationHandler(location);
|
||||
}
|
||||
|
||||
return console.log('com.dyomedea.dyomedea LOG', ' - location: ', location);
|
||||
};
|
||||
|
||||
@@ -103,3 +103,14 @@ describe('Checking trkpt ids', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Checking settings id', () => {
|
||||
test(', vice', () => {
|
||||
const rte = uri('settings', {});
|
||||
expect(rte).toBe('settings');
|
||||
});
|
||||
test(', and versa', () => {
|
||||
const rte = uri('settings', 'settings');
|
||||
expect(rte).toMatchObject({});
|
||||
});
|
||||
});
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import { route } from 'docuri';
|
||||
|
||||
const routes = {
|
||||
config: route('config'),
|
||||
dbdef: route('dbdef'),
|
||||
settings: route('settings'),
|
||||
gpx: route('gpx/:gpx'),
|
||||
trk: route('gpx/:gpx/trk/:trk'),
|
||||
trkseg: route('gpx/:gpx/trk/:trk/:trkseg'),
|
||||
|
||||
Reference in new issue
Block a user