diff --git a/app/components/place-details.gjs b/app/components/place-details.gjs index a665da0..df4d88b 100644 --- a/app/components/place-details.gjs +++ b/app/components/place-details.gjs @@ -515,7 +515,10 @@ export default class PlaceDetails extends Component {
{{/if}} - {{#if this.osmUrl}} + + + {{#if this.osmUrl}} + + {{/if}} {{#if this.isPhotoUploadModalOpen}} diff --git a/app/components/user-menu.gjs b/app/components/user-menu.gjs index c1bac0f..84b9f85 100644 --- a/app/components/user-menu.gjs +++ b/app/components/user-menu.gjs @@ -3,13 +3,17 @@ import { action } from '@ember/object'; import { service } from '@ember/service'; import Icon from '#components/icon'; import { on } from '@ember/modifier'; +import { tracked } from '@glimmer/tracking'; +import { eq } from 'ember-truth-helpers'; +import Modal from './modal'; export default class UserMenuComponent extends Component { @service storage; @service osmAuth; - @service nostrAuth; + @tracked isNostrConnectModalOpen = false; + @action connectRS() { this.args.onClose(); @@ -33,9 +37,31 @@ export default class UserMenuComponent extends Component { } @action - async connectNostr() { + openNostrConnectModal() { + this.isNostrConnectModalOpen = true; + } + + @action + closeNostrConnectModal() { + this.isNostrConnectModalOpen = false; + } + + @action + async connectNostrExtension() { try { - await this.nostrAuth.login(); + await this.nostrAuth.login('extension'); + this.closeNostrConnectModal(); + } catch (e) { + console.error(e); + alert(e.message); + } + } + + @action + async connectNostrApp() { + try { + await this.nostrAuth.login('connect'); + this.closeNostrConnectModal(); } catch (e) { console.error(e); alert(e.message); @@ -47,6 +73,10 @@ export default class UserMenuComponent extends Component { this.nostrAuth.logout(); } + get hasExtension() { + return typeof window !== 'undefined' && typeof window.nostr !== 'undefined'; + } + @@ -140,5 +170,49 @@ export default class UserMenuComponent extends Component { + + {{#if this.isNostrConnectModalOpen}} +Waiting for you to approve the connection in your mobile signer + app...
+