diff --git a/app/components/place-lists-manager.gjs b/app/components/place-lists-manager.gjs index 6f0f24c..49ff73d 100644 --- a/app/components/place-lists-manager.gjs +++ b/app/components/place-lists-manager.gjs @@ -25,10 +25,8 @@ export default class PlaceListsManager extends Component { @action async toggleSaved() { if (this.isSaved) { - if (confirm(`Remove "${this.args.place.title}" from saved places?`)) { - await this.storage.removePlace(this.args.place); - if (this.args.onClose) this.args.onClose(); - } + await this.storage.removePlace(this.args.place); + if (this.args.onClose) this.args.onClose(); } else { await this.storage.storePlace(this.args.place); } diff --git a/app/components/places-sidebar.gjs b/app/components/places-sidebar.gjs index fc74f6b..d356799 100644 --- a/app/components/places-sidebar.gjs +++ b/app/components/places-sidebar.gjs @@ -51,40 +51,39 @@ export default class PlacesSidebar extends Component { if (!place) return; if (place.createdAt) { - if (confirm(`Delete "${place.title}"?`)) { - try { - await this.storage.removePlace(place); - console.debug('Place deleted:', place.title); + // Direct delete without confirmation + try { + await this.storage.removePlace(place); + console.debug('Place deleted:', place.title); - // Notify parent to refresh map bookmarks - if (this.args.onBookmarkChange) { - this.args.onBookmarkChange(); - } - - if (this.args.onUpdate) { - // Reconstruct the "original" place without ID/Geohash/CreatedAt - const freshPlace = { - ...place, - id: undefined, - geohash: undefined, - createdAt: undefined, - }; - this.args.onUpdate(freshPlace); - } - - // Also fire onSelect if it exists (for list view) - if (this.args.onSelect) { - this.args.onSelect(null); - } - - // Close sidebar after delete - if (this.args.onClose) { - this.args.onClose(); - } - } catch (e) { - console.error('Failed to delete:', e); - alert('Failed to delete: ' + e.message); + // Notify parent to refresh map bookmarks + if (this.args.onBookmarkChange) { + this.args.onBookmarkChange(); } + + if (this.args.onUpdate) { + // Reconstruct the "original" place without ID/Geohash/CreatedAt + const freshPlace = { + ...place, + id: undefined, + geohash: undefined, + createdAt: undefined, + }; + this.args.onUpdate(freshPlace); + } + + // Also fire onSelect if it exists (for list view) + if (this.args.onSelect) { + this.args.onSelect(null); + } + + // Close sidebar after delete + if (this.args.onClose) { + this.args.onClose(); + } + } catch (e) { + console.error('Failed to delete:', e); + alert('Failed to delete: ' + e.message); } } else { // It's a fresh POI -> Save it diff --git a/tests/integration/components/place-details-test.gjs b/tests/integration/components/place-details-test.gjs index 7e7ff4d..9f48188 100644 --- a/tests/integration/components/place-details-test.gjs +++ b/tests/integration/components/place-details-test.gjs @@ -127,14 +127,6 @@ module('Integration | Component | place-details', function (hooks) { test('it handles removing a saved place via master toggle', async function (assert) { let removedPlace = null; - let confirmCalled = false; - - // Mock confirm - const originalConfirm = window.confirm; - window.confirm = () => { - confirmCalled = true; - return true; - }; class MockStorage extends Service { lists = []; @@ -168,11 +160,7 @@ module('Integration | Component | place-details', function (hooks) { // Click it to remove await click(masterToggle); - assert.ok(confirmCalled, 'confirm dialog was shown'); assert.strictEqual(removedPlace.id, 'saved-id', 'removePlace was called'); - - // Restore confirm - window.confirm = originalConfirm; }); test('it adds place to a list', async function (assert) {