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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "marco",
"version": "1.20.1",
"version": "1.20.3",
"private": true,
"description": "Unhosted maps app",
"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-TileImage" content="/icons/icon-144.png">
<script type="module" crossorigin src="/assets/main-CGySSjv6.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-BA3LWr76.css">
<script type="module" crossorigin src="/assets/main-CfJ9up1Y.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-CHuW_yI-.css">
</head>
<body>
</body>