From 504e8fab9463c495d29137936d1ec7dc8f812462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sun, 7 Jun 2026 16:28:09 +0400 Subject: [PATCH] Fix lint errors --- app/components/app-menu/settings/nostr.gjs | 9 ++++++-- .../app-menu/settings/nostr-test.gjs | 21 ++++++++++++++----- tests/unit/utils/nostr-test.js | 5 ++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/components/app-menu/settings/nostr.gjs b/app/components/app-menu/settings/nostr.gjs index 89a91f5..7612f9e 100644 --- a/app/components/app-menu/settings/nostr.gjs +++ b/app/components/app-menu/settings/nostr.gjs @@ -60,7 +60,9 @@ export default class AppMenuSettingsNostr extends Component { } get hasReadOverrides() { - return this.customReadRelays.length > 0 || this.readRelayExclusions.length > 0; + return ( + this.customReadRelays.length > 0 || this.readRelayExclusions.length > 0 + ); } get hasWriteOverrides() { @@ -106,7 +108,10 @@ export default class AppMenuSettingsNostr extends Component { ...this.customReadRelays, url, ]); - const custom = excludeRequiredRelays(merged, this.nostrData.requiredReadRelays); + const custom = excludeRequiredRelays( + merged, + this.nostrData.requiredReadRelays + ); const readExclusions = this.readRelayExclusions.filter((relay) => { return normalizeRelayUrl(relay) !== url; diff --git a/tests/integration/components/app-menu/settings/nostr-test.gjs b/tests/integration/components/app-menu/settings/nostr-test.gjs index 9f94254..5fcac34 100644 --- a/tests/integration/components/app-menu/settings/nostr-test.gjs +++ b/tests/integration/components/app-menu/settings/nostr-test.gjs @@ -43,7 +43,10 @@ class MockNostrDataService extends Service { } get activeReadRelays() { - return mergeRequiredRelays(this.requiredReadRelays, this.configuredReadRelays); + return mergeRequiredRelays( + this.requiredReadRelays, + this.configuredReadRelays + ); } get activeWriteRelays() { @@ -131,20 +134,26 @@ module('Integration | Component | app-menu/settings/nostr', function (hooks) { }); test('adding read relay clears existing exclusion for same relay', async function (assert) { - this.settings.update('nostrReadRelayExclusions', ['wss://mailbox.example.com']); + this.settings.update('nostrReadRelayExclusions', [ + 'wss://mailbox.example.com', + ]); const element = await renderAndOpenDetails(this); await fillIn('#new-read-relay', 'Mailbox.EXAMPLE.com/'); await click(element.querySelector('#new-read-relay').nextElementSibling); - assert.deepEqual(this.settings.nostrReadRelays, ['wss://mailbox.example.com']); + assert.deepEqual(this.settings.nostrReadRelays, [ + 'wss://mailbox.example.com', + ]); assert.strictEqual(this.settings.nostrReadRelayExclusions, null); }); test('reset read relays clears additions and exclusions', async function (assert) { this.settings.update('nostrReadRelays', ['wss://custom.example.com']); - this.settings.update('nostrReadRelayExclusions', ['wss://mailbox.example.com']); + this.settings.update('nostrReadRelayExclusions', [ + 'wss://mailbox.example.com', + ]); const element = await renderAndOpenDetails(this); await click(element.querySelectorAll('.reset-relays')[0]); @@ -157,7 +166,9 @@ module('Integration | Component | app-menu/settings/nostr', function (hooks) { }); test('write relays are removable and mailbox delete stores exclusion', async function (assert) { - this.settings.update('nostrWriteRelays', ['wss://custom-write.example.com']); + this.settings.update('nostrWriteRelays', [ + 'wss://custom-write.example.com', + ]); const element = await renderAndOpenDetails(this); const rows = writeRows(element); diff --git a/tests/unit/utils/nostr-test.js b/tests/unit/utils/nostr-test.js index 5b3e2e4..e14349a 100644 --- a/tests/unit/utils/nostr-test.js +++ b/tests/unit/utils/nostr-test.js @@ -197,6 +197,9 @@ module('Unit | Utility | nostr', function () { ['required.example.com'] ); - assert.deepEqual(relays, ['wss://required.example.com', 'wss://custom.example.com']); + assert.deepEqual(relays, [ + 'wss://required.example.com', + 'wss://custom.example.com', + ]); }); });