Merge branch 'develop'

This commit is contained in:
Pieter Vander Vennet 2024-03-08 17:54:28 +01:00
commit 9cb2eb75a6
5 changed files with 18 additions and 21 deletions

View file

@ -85,9 +85,15 @@ export class Imgur extends ImageProvider implements ImageUploader {
* expected.date = new Date(1655052078000)
* expected.views = 2
* licenseInfo // => expected
* const licenseInfoJpeg = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.jpeg")
* licenseInfoJpeg // => expected
* const licenseInfoUpperCase = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.JPEG")
* licenseInfoUpperCase // => expected
*
*
*/
public async DownloadAttribution(url: string): Promise<LicenseInfo> {
const hash = url.substr("https://i.imgur.com/".length).split(".jpg")[0]
const hash = url.substr("https://i.imgur.com/".length).split(/\.jpe?g/i)[0]
const apiUrl = "https://api.imgur.com/3/image/" + hash
const response = await Utils.downloadJsonCached(apiUrl, 365 * 24 * 60 * 60, {

View file

@ -134,9 +134,10 @@ export class MoveWizardState {
// This is a new point. Check if it was snapped to an existing way due to the '_referencing_ways'-tag
const store = this._state.featureProperties.getStore(id)
store?.addCallbackAndRunD((tags) => {
if (tags._referencing_ways !== "[]") {
if (tags._referencing_ways !== undefined && tags._referencing_ways !== "[]") {
console.log("Got referencing ways according to the tags")
this.moveDisallowedReason.setData(t.partOfAWay)
return true
}
})
}