Hide zap button when inappropriate
* Current user has No Nostr pubkey connected * Creator can't accept zaps * Creator is current user (self-zap)
This commit is contained in:
@@ -9,7 +9,12 @@ export class MockNostrAuthService extends Service {
|
||||
@tracked connectUri = null;
|
||||
|
||||
get isConnected() {
|
||||
return false;
|
||||
return (
|
||||
!!this.pubkey &&
|
||||
(this.signerType === 'extension'
|
||||
? typeof window !== 'undefined' && typeof window.nostr !== 'undefined'
|
||||
: true)
|
||||
);
|
||||
}
|
||||
|
||||
get isMobile() {
|
||||
|
||||
@@ -480,7 +480,8 @@ module('Integration | Component | photo-gallery', function (hooks) {
|
||||
});
|
||||
|
||||
test('it shows Zap this photo in the dropdown', async function (assert) {
|
||||
this.nostrAuth.pubkey = USER_A;
|
||||
this.nostrAuth.pubkey = USER_B;
|
||||
this.nostrAuth.signerType = 'connect';
|
||||
this.selectedPhoto = this.photos[0];
|
||||
|
||||
await render(
|
||||
@@ -508,7 +509,8 @@ module('Integration | Component | photo-gallery', function (hooks) {
|
||||
});
|
||||
|
||||
test('it opens zap modal when Zap this photo is clicked', async function (assert) {
|
||||
this.nostrAuth.pubkey = USER_A;
|
||||
this.nostrAuth.pubkey = USER_B;
|
||||
this.nostrAuth.signerType = 'connect';
|
||||
this.selectedPhoto = this.photos[0];
|
||||
|
||||
await render(
|
||||
|
||||
Reference in New Issue
Block a user