From d7083131a130ddc171de2b96d9bc15847830c5df Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 22 Sep 2020 01:32:36 +0200 Subject: [PATCH] Set default license if none is set while uploading --- Logic/Osm/OsmImageUploadHandler.ts | 2 +- UI/Image/ImageCarouselWithUpload.ts | 8 -------- UI/ImageUploadFlow.ts | 4 ++++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Logic/Osm/OsmImageUploadHandler.ts b/Logic/Osm/OsmImageUploadHandler.ts index cce2947..057a0b6 100644 --- a/Logic/Osm/OsmImageUploadHandler.ts +++ b/Logic/Osm/OsmImageUploadHandler.ts @@ -24,7 +24,7 @@ export class OsmImageUploadHandler { private generateOptions(license: string) { const tags = this._tags.data; const self = this; - + license = license ?? "CC0" const title = tags.name ?? "Unknown area"; const description = [ "author:" + State.state.osmConnection.userDetails.data.name, diff --git a/UI/Image/ImageCarouselWithUpload.ts b/UI/Image/ImageCarouselWithUpload.ts index eaa6d2c..7694fad 100644 --- a/UI/Image/ImageCarouselWithUpload.ts +++ b/UI/Image/ImageCarouselWithUpload.ts @@ -19,10 +19,6 @@ export default class ImageCarouselWithUploadConstructor implements TagDependantU return false; } - Priority(): number { - return 0; - } - construct(dependencies): TagDependantUIElement { return new ImageCarouselWithUpload(dependencies); } @@ -62,8 +58,4 @@ class ImageCarouselWithUpload extends TagDependantUIElement { return false; } - Priority(): number { - return 0; - } - } \ No newline at end of file diff --git a/UI/ImageUploadFlow.ts b/UI/ImageUploadFlow.ts index 3be2d40..0095c8e 100644 --- a/UI/ImageUploadFlow.ts +++ b/UI/ImageUploadFlow.ts @@ -148,6 +148,10 @@ export class ImageUploadFlow extends UIElement { self._isUploading.setData(files.length); self._allDone.setData(false); + if(self._selectedLicence.data === undefined){ + self._selectedLicence.setData("CC0"); + } + const opts = self._uploadOptions(self._selectedLicence.data); Imgur.uploadMultiple(opts.title, opts.description, files,