Don't compact trksegs if you don't own them
This commit is contained in:
parent
c1f1c8afb0
commit
bb763435ef
|
@ -61,6 +61,7 @@ export const watchDbLegacy = async () => {
|
||||||
const newState = {
|
const newState = {
|
||||||
...state(),
|
...state(),
|
||||||
dbName: status()?.dbInfo?.db_name,
|
dbName: status()?.dbInfo?.db_name,
|
||||||
|
userId: dbUrlToUserId(status()?.remoteDbInfo?.host),
|
||||||
localUpdateSeq: status()?.dbInfo?.update_seq,
|
localUpdateSeq: status()?.dbInfo?.update_seq,
|
||||||
remoteUrl: status()?.remoteDbInfo?.host,
|
remoteUrl: status()?.remoteDbInfo?.host,
|
||||||
sync: syncState(),
|
sync: syncState(),
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
import { state } from '../db-admin/health-legacy';
|
||||||
import getUri, { intToTrkptId } from '../lib/ids';
|
import getUri, { intToTrkptId } from '../lib/ids';
|
||||||
import { appendToArray } from './gpx';
|
import { appendToArray } from './gpx';
|
||||||
import { getFamily, put } from './lib';
|
import { getFamily, put } from './lib';
|
||||||
|
@ -43,7 +44,7 @@ export const getTrksegDocs: ({
|
||||||
export const getTrkseg = async (params: any) => {
|
export const getTrkseg = async (params: any) => {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
const { docs, trkseg } = await getTrksegDocs(params);
|
const { docs, trkseg } = await getTrksegDocs(params);
|
||||||
if (docs.rows.length > 1) {
|
if (docs.rows.length > 1 && docs.rows[0].doc.origin === state().userId) {
|
||||||
// console.log({
|
// console.log({
|
||||||
// caller: 'getTrkseg compactRteOrTrksegDebounced required',
|
// caller: 'getTrkseg compactRteOrTrksegDebounced required',
|
||||||
// id,
|
// id,
|
||||||
|
|
Loading…
Reference in New Issue