import Component from '@glimmer/component'; import { action } from '@ember/object'; import { service } from '@ember/service'; import Icon from '#components/icon'; import { on } from '@ember/modifier'; export default class UserMenuComponent extends Component { @service storage; @service osmAuth; @service nostrAuth; @action connectRS() { this.args.onClose(); this.args.storage.showConnectWidget(); } @action disconnectRS() { this.args.storage.disconnect(); } @action connectOsm() { this.args.onClose(); this.osmAuth.login(); } @action disconnectOsm() { this.osmAuth.logout(); } @action async connectNostr() { try { await this.nostrAuth.login(); } catch (e) { console.error(e); alert(e.message); } } @action disconnectNostr() { this.nostrAuth.logout(); } }