-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nostr Preferences #1186
Open
sarthak13gupta
wants to merge
56
commits into
breez:master
Choose a base branch
from
sarthak13gupta:nostr_preferences
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Nostr Preferences #1186
Changes from 33 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
ddcafa7
comments platform
sarthak13gupta 4d1c991
merge changes
sarthak13gupta 5062f78
toggle comments check
sarthak13gupta cc0cdc8
adding nostr screen
sarthak13gupta 2926867
Merge remote-tracking branch 'origin/toggle_comments_check' into nost…
sarthak13gupta 4ddc46b
nostr screen login/logout
sarthak13gupta e93e05a
Merge branch 'master' of https://github.com/breez/breezmobile into co…
sarthak13gupta ea79bd3
Merge branch 'master' of https://github.com/breez/breezmobile into to…
sarthak13gupta 93a0761
toggle comments changes
sarthak13gupta 5f7e0da
Disable Nostr title corrected
sarthak13gupta 87cffd5
Merge branch 'toggle_comments_check' of https://github.com/sarthak13g…
sarthak13gupta 610bed5
anytime ref changes
sarthak13gupta 71ec1b8
Merge branch 'master' of https://github.com/sarthak13gupta/breezmobil…
sarthak13gupta 1a66294
Merge branch 'nostr_screen_check' of https://github.com/sarthak13gupt…
sarthak13gupta 050959a
Merge branch 'comments_platform' of https://github.com/sarthak13gupta…
sarthak13gupta 69a2d14
Merge branch 'nostr_screen' of https://github.com/sarthak13gupta/bree…
sarthak13gupta a4e1dfb
anytime ref
sarthak13gupta c7df79c
Merge branch 'nostr_screen' of https://github.com/sarthak13gupta/bree…
sarthak13gupta 7d180ca
login via comments platform
sarthak13gupta 2896791
login from snort
sarthak13gupta 00768ff
Merge branch 'master' into comments_platform
sarthak13gupta d129527
added primal and publishing relays
sarthak13gupta 3cb85da
merge changes
sarthak13gupta 0b5c827
previous primal logo removed
sarthak13gupta 9100324
commentsBloc -> NostrCommentBloc
sarthak13gupta 111cba4
Merge branch 'comments_platform' of https://github.com/sarthak13gupta…
sarthak13gupta 7c89fcb
Merge branch 'master' of https://github.com/sarthak13gupta/breezmobil…
sarthak13gupta fece6dd
nostr-connect
sarthak13gupta 232c075
merge_conflicts
sarthak13gupta a38365a
mobile scanner -> 3.3.0
sarthak13gupta 8b06da9
saving relays in preferences
sarthak13gupta 36716be
anytime ref changes
sarthak13gupta 0a6682b
removing unwanted comments
sarthak13gupta e24e7a2
review changes part-1
sarthak13gupta 22e0afe
anytime ref changes
sarthak13gupta f37483d
making nostrPrivateKey a private field in the NostrBloc class
sarthak13gupta 5cfabec
merge changes nostr_preferences
sarthak13gupta 9b0b60f
removing secure_storage
sarthak13gupta 032060e
LoginWithImportedNostrKey-> StoreNostrKey
sarthak13gupta bff6f67
moving nostrSettings inside nostrBloc (part-1)
sarthak13gupta 43ee2e6
moving nostrSettings inside nostrBloc (part-2) completed
sarthak13gupta 225aa13
nip04 operations corrected
sarthak13gupta f2d5954
nip04 operations corrected(nostrBloc)
sarthak13gupta f898084
injecting nostrComments from BreezMobile to Anytime(without toggling)
sarthak13gupta 40ed1d7
toggling comments added
sarthak13gupta 46fad4e
Merge branch 'master' into comments_platform
sarthak13gupta 5304183
merge conflicts
sarthak13gupta d8abd95
aligning nostrComments with nostr_preferences
sarthak13gupta 5019311
Merge branch 'master' into nostr_preferences
sarthak13gupta d6413f7
mobile_scanner 3.3.0 changes
sarthak13gupta 7386fec
nostr_preferences merge changes
sarthak13gupta 0a59d5b
merge changes
sarthak13gupta e046651
anytime ref and adding nostr preferences in the home_navigation_drawer
sarthak13gupta fe0e4c1
Merge branch 'master' into nostr_preferences
sarthak13gupta 945c696
Merge branch 'master' into nostr_preferences
sarthak13gupta 7f9e329
Update dev.dart
sarthak13gupta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,79 @@ | ||
|
||
|
||
class NostrSettings { | ||
final bool showSnort; | ||
final bool enableNostr; | ||
final bool isRememberPubKey; | ||
final bool isRememberSignEvent; | ||
final bool isLoggedIn; | ||
List<String> relayList; | ||
|
||
NostrSettings( | ||
{this.showSnort = true, | ||
this.isRememberPubKey = false, | ||
this.isRememberSignEvent = false}); | ||
static List<String> defaultRelayList = [ | ||
"wss://relay.damus.io", | ||
"wss://nostr1.tunnelsats.com", | ||
"wss://nostr-pub.wellorder.net", | ||
"wss://relay.nostr.info", | ||
"wss://nostr-relay.wlvs.space", | ||
"wss://nostr.bitcoiner.social", | ||
"wss://nostr-01.bolt.observer", | ||
"wss://relayer.fiatjaf.com", | ||
]; | ||
|
||
NostrSettings({ | ||
this.enableNostr = true, | ||
this.isRememberPubKey = false, | ||
this.isRememberSignEvent = false, | ||
this.isLoggedIn = false, | ||
this.relayList = const [], | ||
}); | ||
|
||
static const String NOSTR_SETTINGS_PREFERENCES_KEY = "nostr_settings"; | ||
|
||
NostrSettings.start() | ||
: this( | ||
showSnort: true, | ||
isRememberPubKey: false, | ||
isRememberSignEvent: false, | ||
// start should be done by retrieving the values set in sharedPreferences | ||
NostrSettings.start({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: rename |
||
bool enableNostr, | ||
bool isRememberPubKey, | ||
bool isRememberSignEvent, | ||
bool isLoggedIn, | ||
List<String> relayList, | ||
}) : this( | ||
enableNostr: enableNostr ?? true, | ||
isRememberPubKey: isRememberPubKey ?? false, | ||
isRememberSignEvent: isRememberSignEvent ?? false, | ||
isLoggedIn: isLoggedIn ?? false, | ||
relayList: relayList ?? defaultRelayList, | ||
); | ||
|
||
NostrSettings copyWith( | ||
{bool showSnort, bool isRememberPubKey, bool isRememberSignEvent}) { | ||
NostrSettings copyWith({ | ||
bool enableNostr, | ||
bool isRememberPubKey, | ||
bool isRememberSignEvent, | ||
bool isLoggedIn, | ||
List<String> relayList, | ||
}) { | ||
return NostrSettings( | ||
showSnort: showSnort ?? this.showSnort, | ||
enableNostr: enableNostr ?? this.enableNostr, | ||
isRememberPubKey: isRememberPubKey ?? this.isRememberPubKey, | ||
isRememberSignEvent: isRememberSignEvent ?? this.isRememberSignEvent, | ||
isLoggedIn: isLoggedIn ?? this.isLoggedIn, | ||
relayList: relayList ?? this.relayList, | ||
); | ||
} | ||
|
||
NostrSettings.fromJson(Map<String, dynamic> json) | ||
: this( | ||
showSnort: json["showSnort"] ?? true, | ||
enableNostr: json["enableNostr"] ?? true, | ||
isRememberPubKey: json["isRememberPubKey"] ?? false, | ||
isRememberSignEvent: json["isRememberSignEvent"] ?? false, | ||
isLoggedIn: json["isLoggedIn"] ?? false, | ||
relayList: (json["relayList"] as List<dynamic>) | ||
.map((item) => item.toString()) | ||
.toList() ?? | ||
defaultRelayList, | ||
); | ||
|
||
Map<String, dynamic> toJson() => { | ||
"showSnort": showSnort, | ||
"enableNostr": enableNostr, | ||
"isRememberPubKey": isRememberPubKey, | ||
"isRememberSignEvent": isRememberSignEvent, | ||
"isLoggedIn": isLoggedIn, | ||
"relayList": relayList, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not changing any of the
NostrSettings
values, we can add it directly as: