Chore: remove some obsolete console.logs

This commit is contained in:
Pieter Vander Vennet 2023-09-25 02:11:42 +02:00
parent 57e0093e47
commit 6f5b0622a5
13 changed files with 39 additions and 53 deletions

View file

@ -1,43 +0,0 @@
import { UIEventSource } from "../UIEventSource"
import { Imgur } from "./Imgur"
export default class ImgurUploader {
public readonly queue: UIEventSource<string[]> = new UIEventSource<string[]>([])
public readonly failed: UIEventSource<string[]> = new UIEventSource<string[]>([])
public readonly success: UIEventSource<string[]> = new UIEventSource<string[]>([])
public maxFileSizeInMegabytes = 10
private readonly _handleSuccessUrl: (string) => Promise<void>
constructor(handleSuccessUrl: (string) => Promise<void>) {
this._handleSuccessUrl = handleSuccessUrl
}
public uploadMany(title: string, description: string, files: FileList): void {
for (let i = 0; i < files.length; i++) {
this.queue.data.push(files.item(i).name)
}
this.queue.ping()
const self = this
this.queue.setData([...self.queue.data])
Imgur.uploadMultiple(
title,
description,
files,
async function (url) {
console.log("File saved at", url)
self.success.data.push(url)
self.success.ping()
await self._handleSuccessUrl(url)
},
function () {
console.log("All uploads completed")
},
function (failReason) {
console.log("Upload failed due to ", failReason)
self.failed.setData([...self.failed.data, failReason])
}
)
}
}

View file

@ -5,6 +5,7 @@ import Locale from "../../UI/i18n/Locale"
import Constants from "../../Models/Constants"
import { Changes } from "./Changes"
import { Utils } from "../../Utils"
import FeaturePropertiesStore from "../FeatureSource/Actors/FeaturePropertiesStore";
export interface ChangesetTag {
key: string
@ -13,7 +14,7 @@ export interface ChangesetTag {
}
export class ChangesetHandler {
private readonly allElements: { addAlias: (id0: String, id1: string) => void }
private readonly allElements: FeaturePropertiesStore
private osmConnection: OsmConnection
private readonly changes: Changes
private readonly _dryRun: Store<boolean>
@ -29,11 +30,11 @@ export class ChangesetHandler {
constructor(
dryRun: Store<boolean>,
osmConnection: OsmConnection,
allElements: { addAlias: (id0: string, id1: string) => void } | undefined,
allElements: FeaturePropertiesStore | { addAlias: (id0: string, id1: string) => void } | undefined,
changes: Changes
) {
this.osmConnection = osmConnection
this.allElements = allElements
this.allElements = <FeaturePropertiesStore> allElements
this.changes = changes
this._dryRun = dryRun
this.userDetails = osmConnection.userDetails

View file

@ -61,7 +61,6 @@ export class GeoLocationState {
const self = this;
this.permission.addCallbackAndRunD(async (state) => {
console.trace("GEOPERMISSION", state)
if (state === "granted") {
self._previousLocationGrant.setData("true");
self._grantedThisSession.setData(true);

View file

@ -9,6 +9,6 @@ export class ThemeMetaTagging {
Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_a', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.href.match(/mastodon|en.osm.town/) !== null)[0]?.href }) (feat) )
Utils.AddLazyProperty(feat.properties, '_mastodon_link', () => (feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName("a")).filter(a => a.getAttribute("rel")?.indexOf('me') >= 0)[0]?.href})(feat) )
Utils.AddLazyProperty(feat.properties, '_mastodon_candidate', () => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a )
Utils.AddLazyProperty(feat.properties, '__current_background', () => 'initial_value' )
feat.properties['__current_backgroun'] = 'initial_value'
}
}

View file

@ -515,7 +515,7 @@ class MappedStore<TIn, T> extends Store<T> {
}
private unregisterFromUpstream() {
console.log("Unregistering callbacks for", this.tag)
console.debug("Unregistering callbacks for", this.tag)
this._callbacksAreRegistered = false
this._unregisterFromUpstream()
this._unregisterFromExtraStores?.forEach((unr) => unr())