Skip to content
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

Comments platform #1177

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ddcafa7
comments platform
sarthak13gupta Jul 22, 2023
4d1c991
merge changes
sarthak13gupta Jul 22, 2023
5062f78
toggle comments check
sarthak13gupta Jul 23, 2023
e93e05a
Merge branch 'master' of https://github.com/breez/breezmobile into co…
sarthak13gupta Jul 27, 2023
ea79bd3
Merge branch 'master' of https://github.com/breez/breezmobile into to…
sarthak13gupta Jul 27, 2023
93a0761
toggle comments changes
sarthak13gupta Jul 27, 2023
5f7e0da
Disable Nostr title corrected
sarthak13gupta Jul 27, 2023
87cffd5
Merge branch 'toggle_comments_check' of https://github.com/sarthak13g…
sarthak13gupta Jul 29, 2023
610bed5
anytime ref changes
sarthak13gupta Jul 29, 2023
00768ff
Merge branch 'master' into comments_platform
sarthak13gupta Aug 3, 2023
9100324
commentsBloc -> NostrCommentBloc
sarthak13gupta Aug 11, 2023
111cba4
Merge branch 'comments_platform' of https://github.com/sarthak13gupta…
sarthak13gupta Aug 11, 2023
7c89fcb
Merge branch 'master' of https://github.com/sarthak13gupta/breezmobil…
sarthak13gupta Aug 11, 2023
22e0afe
anytime ref changes
sarthak13gupta Aug 15, 2023
f898084
injecting nostrComments from BreezMobile to Anytime(without toggling)
sarthak13gupta Sep 5, 2023
40ed1d7
toggling comments added
sarthak13gupta Sep 6, 2023
46fad4e
Merge branch 'master' into comments_platform
sarthak13gupta Sep 7, 2023
da194bd
Merge branch 'master' into comments_platform
sarthak13gupta Sep 16, 2023
a7b8b2c
Merge branch 'master' into comments_platform
sarthak13gupta Oct 13, 2023
f3de8f9
Merge branch 'master' into comments_platform
sarthak13gupta Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/bloc/app_blocs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:breez/bloc/connect_pay/connect_pay_bloc.dart';
import 'package:breez/bloc/fastbitcoins/fastbitcoins_bloc.dart';
import 'package:breez/bloc/lnurl/lnurl_bloc.dart';
import 'package:breez/bloc/marketplace/marketplace_bloc.dart';
import 'package:breez/bloc/nostr/nostr_bloc.dart';
import 'package:breez/bloc/payment_options/payment_options_bloc.dart';
import 'package:breez/bloc/podcast_clip/podcast_clip_bloc.dart';
import 'package:breez/bloc/podcast_history/podcast_history_bloc.dart';
Expand All @@ -26,6 +27,7 @@ class AppBlocs {
final InvoiceBloc invoicesBloc;
final ConnectPayBloc connectPayBloc;
final BackupBloc backupBloc;
final NostrBloc nostrBloc;
final MarketplaceBloc marketplaceBloc;
final FastbitcoinsBloc fastbitcoinsBloc;
final LSPBloc lspBloc;
Expand Down Expand Up @@ -74,6 +76,7 @@ class AppBlocs {
blocsByType);
MarketplaceBloc marketplaceBloc =
_registerBloc(MarketplaceBloc(), blocsByType);
NostrBloc nostrBloc = _registerBloc(NostrBloc(), blocsByType);
LSPBloc lspBloc =
_registerBloc(LSPBloc(accountBloc.accountStream), blocsByType);
LNUrlBloc lnurlBloc = _registerBloc(LNUrlBloc(), blocsByType);
Expand Down Expand Up @@ -110,6 +113,7 @@ class AppBlocs {
invoicesBloc,
connectPayBloc,
backupBloc,
nostrBloc,
marketplaceBloc,
fastbitcoinsBloc,
lspBloc,
Expand All @@ -129,6 +133,7 @@ class AppBlocs {
this.invoicesBloc,
this.connectPayBloc,
this.backupBloc,
this.nostrBloc,
this.marketplaceBloc,
this.fastbitcoinsBloc,
this.lspBloc,
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/marketplace/marketplace_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MarketplaceBloc {
_listenNostrSettings() async {
SharedPreferences pref = await SharedPreferences.getInstance();
nostrSettingsStream.listen((settings) async {
_isSnortToggled = settings.showSnort;
_isSnortToggled = settings.enableNostr;
pref.setString(NostrSettings.NOSTR_SETTINGS_PREFERENCES_KEY,
json.encode(settings.toJson()));
await loadVendors();
Expand Down
16 changes: 7 additions & 9 deletions lib/bloc/marketplace/nostr_settings.dart
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@


class NostrSettings {
final bool showSnort;
final bool enableNostr;
final bool isRememberPubKey;
final bool isRememberSignEvent;

NostrSettings(
{this.showSnort = true,
{this.enableNostr = true,
this.isRememberPubKey = false,
this.isRememberSignEvent = false});

static const String NOSTR_SETTINGS_PREFERENCES_KEY = "nostr_settings";

NostrSettings.initial()
: this(
showSnort: true,
enableNostr: true,
isRememberPubKey: false,
isRememberSignEvent: false,
);

NostrSettings copyWith(
{bool showSnort, bool isRememberPubKey, bool isRememberSignEvent}) {
{bool enableNostr, bool isRememberPubKey, bool isRememberSignEvent}) {
return NostrSettings(
showSnort: showSnort ?? this.showSnort,
enableNostr: enableNostr ?? this.enableNostr,
isRememberPubKey: isRememberPubKey ?? this.isRememberPubKey,
isRememberSignEvent: isRememberSignEvent ?? this.isRememberSignEvent,
);
}

NostrSettings.fromJson(Map<String, dynamic> json)
: this(
showSnort: json["showSnort"] ?? true,
enableNostr: json["enableNostr"] ?? true,
isRememberPubKey: json["isRememberPubKey"] ?? false,
isRememberSignEvent: json["isRememberSignEvent"] ?? false,
);

Map<String, dynamic> toJson() => {
"showSnort": showSnort,
"enableNostr": enableNostr,
"isRememberPubKey": isRememberPubKey,
"isRememberSignEvent": isRememberSignEvent,
};
Expand Down
Loading
Loading