Removing a few console.log...
This commit is contained in:
1 parent
5a5931dbcd
commit
4502162a36
4 files changed
+54
-54
No files matched your search
+20
-20
@@ -43,7 +43,7 @@ for (const property in methods) {
|
||||
}
|
||||
|
||||
const changeHandler = async (change: any) => {
|
||||
console.log({ caller: 'ChangeHandler', change, watches: globalThis.watches });
|
||||
// console.log({ caller: 'ChangeHandler', change, watches: globalThis.watches });
|
||||
const { id } = change;
|
||||
if (!globalThis.watches) {
|
||||
globalThis.watches = new Map();
|
||||
@@ -55,22 +55,22 @@ const changeHandler = async (change: any) => {
|
||||
tokens.splice(-1);
|
||||
}
|
||||
const parentId = tokens.join('/');
|
||||
console.log({
|
||||
caller: 'ChangeHandler',
|
||||
change,
|
||||
watches: globalThis.watches,
|
||||
parentId,
|
||||
});
|
||||
// console.log({
|
||||
// caller: 'ChangeHandler',
|
||||
// change,
|
||||
// watches: globalThis.watches,
|
||||
// parentId,
|
||||
// });
|
||||
|
||||
if (parentId === 'gpx') {
|
||||
const gpxes = await getAllGpxes();
|
||||
console.log({ caller: 'changeHandler / gpxes', gpxes, id });
|
||||
// console.log({ caller: 'changeHandler / gpxes', gpxes, id });
|
||||
if (!gpxes.includes(id)) {
|
||||
await put(
|
||||
parentId,
|
||||
`idx-${parentId}`,
|
||||
(doc) => {
|
||||
console.log({ caller: 'changeHandler / gpxes', doc });
|
||||
// console.log({ caller: 'changeHandler / gpxes', doc });
|
||||
doc.push(id);
|
||||
doc.reverse().sort().reverse();
|
||||
return doc;
|
||||
@@ -89,23 +89,23 @@ const changeHandler = async (change: any) => {
|
||||
export default changeHandler;
|
||||
|
||||
export const getAndWatch = async (params: any) => {
|
||||
console.log({
|
||||
caller: 'ChangeHandler / getAndWatch',
|
||||
params,
|
||||
watches: globalThis.watches,
|
||||
});
|
||||
// console.log({
|
||||
// caller: 'ChangeHandler / getAndWatch',
|
||||
// params,
|
||||
// watches: globalThis.watches,
|
||||
// });
|
||||
const { method, _dispatchId, id, ...otherParams } = params;
|
||||
if (!globalThis.watches) {
|
||||
globalThis.watches = new Map();
|
||||
}
|
||||
globalThis.watches.set(id, params);
|
||||
const returnValue = await methods[<keyof typeof methods>method](params);
|
||||
console.log({
|
||||
caller: 'ChangeHandler / getAndWatch',
|
||||
params,
|
||||
returnValue,
|
||||
watches: globalThis.watches,
|
||||
});
|
||||
// console.log({
|
||||
// caller: 'ChangeHandler / getAndWatch',
|
||||
// params,
|
||||
// returnValue,
|
||||
// watches: globalThis.watches,
|
||||
// });
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user