Compare commits

...

4 Commits

Author SHA1 Message Date
1ba4afdf08 1.20.3
All checks were successful
CI / Lint (push) Successful in 31s
CI / Test (push) Successful in 57s
2026-04-24 13:55:07 +01:00
d764134513 Remove superfluous publishing status alert 2026-04-24 13:53:40 +01:00
e38f540c79 1.20.2
All checks were successful
CI / Lint (push) Successful in 32s
CI / Test (push) Successful in 58s
2026-04-24 12:28:08 +01:00
73ad5b4eb1 Disable closing modal during photo upload 2026-04-24 12:24:19 +01:00
11 changed files with 46 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ export default class Modal extends Component {
@action @action
close() { close() {
if (this.args.disableClose) return;
if (this.args.onClose) { if (this.args.onClose) {
this.args.onClose(); this.args.onClose();
} }
@@ -31,10 +32,11 @@ export default class Modal extends Component {
> >
<button <button
type="button" type="button"
class="close-modal-btn btn-text" class="close-modal-btn btn-text {{if @disableClose 'disabled'}}"
disabled={{@disableClose}}
{{on "click" this.close}} {{on "click" this.close}}
> >
<Icon @name="x" @size={{24}} /> <Icon @name="x" @size={{24}} @color="currentColor" />
</button> </button>
{{yield}} {{yield}}
</div> </div>

View File

@@ -27,6 +27,12 @@ export default class PlaceDetails extends Component {
@tracked isPhotoUploadModalOpen = false; @tracked isPhotoUploadModalOpen = false;
@tracked isNostrConnectModalOpen = false; @tracked isNostrConnectModalOpen = false;
@tracked newlyUploadedPhotoId = null; @tracked newlyUploadedPhotoId = null;
@tracked isPhotoUploadActive = false;
@action
handleUploadStateChange(isActive) {
this.isPhotoUploadActive = isActive;
}
@action @action
openPhotoUploadModal(e) { openPhotoUploadModal(e) {
@@ -42,6 +48,7 @@ export default class PlaceDetails extends Component {
@action @action
closePhotoUploadModal(eventId) { closePhotoUploadModal(eventId) {
if (this.isPhotoUploadActive) return;
this.isPhotoUploadModalOpen = false; this.isPhotoUploadModalOpen = false;
if (typeof eventId === 'string') { if (typeof eventId === 'string') {
this.newlyUploadedPhotoId = eventId; this.newlyUploadedPhotoId = eventId;
@@ -585,10 +592,14 @@ export default class PlaceDetails extends Component {
</div> </div>
{{#if this.isPhotoUploadModalOpen}} {{#if this.isPhotoUploadModalOpen}}
<Modal @onClose={{this.closePhotoUploadModal}}> <Modal
@onClose={{this.closePhotoUploadModal}}
@disableClose={{this.isPhotoUploadActive}}
>
<PlacePhotoUpload <PlacePhotoUpload
@place={{this.saveablePlace}} @place={{this.saveablePlace}}
@onClose={{this.closePhotoUploadModal}} @onClose={{this.closePhotoUploadModal}}
@onUploadStateChange={{this.handleUploadStateChange}}
/> />
</Modal> </Modal>
{{/if}} {{/if}}

View File

@@ -19,7 +19,6 @@ export default class PlacePhotoUpload extends Component {
@tracked file = null; @tracked file = null;
@tracked uploadedPhoto = null; @tracked uploadedPhoto = null;
@tracked status = '';
@tracked error = ''; @tracked error = '';
@tracked isPublishing = false; @tracked isPublishing = false;
@tracked isDragging = false; @tracked isDragging = false;
@@ -77,6 +76,9 @@ export default class PlacePhotoUpload extends Component {
} }
this.file = file; this.file = file;
this.uploadedPhoto = null; this.uploadedPhoto = null;
if (this.args.onUploadStateChange) {
this.args.onUploadStateChange(true);
}
} }
@action @action
@@ -91,6 +93,9 @@ export default class PlacePhotoUpload extends Component {
} }
this.file = null; this.file = null;
this.uploadedPhoto = null; this.uploadedPhoto = null;
if (this.args.onUploadStateChange) {
this.args.onUploadStateChange(false);
}
} }
deletePhotoTask = task(async (photoData) => { deletePhotoTask = task(async (photoData) => {
@@ -126,7 +131,6 @@ export default class PlacePhotoUpload extends Component {
return; return;
} }
this.status = 'Publishing event...';
this.error = ''; this.error = '';
this.isPublishing = true; this.isPublishing = true;
@@ -185,18 +189,20 @@ export default class PlacePhotoUpload extends Component {
this.nostrData.store.add(event); this.nostrData.store.add(event);
this.toast.show('Photo published successfully'); this.toast.show('Photo published successfully');
this.status = '';
// Clear out the file so user can upload more or be done // Clear out the file so user can upload more or be done
this.file = null; this.file = null;
this.uploadedPhoto = null; this.uploadedPhoto = null;
if (this.args.onUploadStateChange) {
this.args.onUploadStateChange(false);
}
if (this.args.onClose) { if (this.args.onClose) {
this.args.onClose(event.id); this.args.onClose(event.id);
} }
} catch (e) { } catch (e) {
this.error = 'Failed to publish: ' + e.message; this.error = 'Failed to publish: ' + e.message;
this.status = '';
} finally { } finally {
this.isPublishing = false; this.isPublishing = false;
} }
@@ -212,12 +218,6 @@ export default class PlacePhotoUpload extends Component {
</div> </div>
{{/if}} {{/if}}
{{#if this.status}}
<div class="alert alert-info">
{{this.status}}
</div>
{{/if}}
{{#if this.file}} {{#if this.file}}
<div class="photo-grid"> <div class="photo-grid">
<PlacePhotoUploadItem <PlacePhotoUploadItem

View File

@@ -1815,6 +1815,12 @@ button.create-place {
top: 1rem; top: 1rem;
right: 1rem; right: 1rem;
cursor: pointer; cursor: pointer;
color: #898989;
}
.close-modal-btn.disabled {
color: #ccc;
cursor: not-allowed;
} }
.place-photo-upload h2 { .place-photo-upload h2 {
@@ -1833,11 +1839,6 @@ button.create-place {
color: #c00; color: #c00;
} }
.alert-info {
background: #eef;
color: #00c;
}
.preview-group { .preview-group {
margin-bottom: 1rem; margin-bottom: 1rem;
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "marco", "name": "marco",
"version": "1.20.1", "version": "1.20.3",
"private": true, "private": true,
"description": "Unhosted maps app", "description": "Unhosted maps app",
"repository": { "repository": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -39,8 +39,8 @@
<meta name="msapplication-TileColor" content="#F6E9A6"> <meta name="msapplication-TileColor" content="#F6E9A6">
<meta name="msapplication-TileImage" content="/icons/icon-144.png"> <meta name="msapplication-TileImage" content="/icons/icon-144.png">
<script type="module" crossorigin src="/assets/main-CGySSjv6.js"></script> <script type="module" crossorigin src="/assets/main-CfJ9up1Y.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-BA3LWr76.css"> <link rel="stylesheet" crossorigin href="/assets/main-CHuW_yI-.css">
</head> </head>
<body> <body>
</body> </body>