Don't compact trksegs if you don't own them

This commit is contained in:
Eric van der Vlist 2023-03-07 18:41:05 +01:00
parent c1f1c8afb0
commit bb763435ef
2 changed files with 3 additions and 1 deletions

View File

@ -61,6 +61,7 @@ export const watchDbLegacy = async () => {
const newState = {
...state(),
dbName: status()?.dbInfo?.db_name,
userId: dbUrlToUserId(status()?.remoteDbInfo?.host),
localUpdateSeq: status()?.dbInfo?.update_seq,
remoteUrl: status()?.remoteDbInfo?.host,
sync: syncState(),

View File

@ -1,4 +1,5 @@
import { cloneDeep } from 'lodash';
import { state } from '../db-admin/health-legacy';
import getUri, { intToTrkptId } from '../lib/ids';
import { appendToArray } from './gpx';
import { getFamily, put } from './lib';
@ -43,7 +44,7 @@ export const getTrksegDocs: ({
export const getTrkseg = async (params: any) => {
const { id } = 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({
// caller: 'getTrkseg compactRteOrTrksegDebounced required',
// id,