fix silent payments appearing in non-btc wallets
Robert Malikowski committed
Jul 3, 2026 at 14:55 UTC
14dcea5e1a04c643ec7d8fa617e8c95ddbffee03
1 file changed
+109
-98
lib/view_model/dashboard/dashboard_view_model.dart
+109
-98
@@ -96,104 +96,8 @@ abstract class DashboardViewModelBase with Store {
96
isShowFirstYatIntroduction = false,
97
isShowSecondYatIntroduction = false,
98
isShowThirdYatIntroduction = false,
99
- filterItems = [
100
- // FilterItem(
101
- // value: () => transactionFilterStore.displayAll,
102
- // caption: S.current.all_transactions,
103
- // onChanged: transactionFilterStore.toggleAll),
104
- FilterItem(
105
- value: () => transactionFilterStore.displayOutgoing,
106
- caption: S.current.send,
107
- onChanged: transactionFilterStore.toggleOutgoing),
108
- FilterItem(
109
- value: () => transactionFilterStore.displayIncoming,
110
- caption: S.current.receive,
111
- onChanged: transactionFilterStore.toggleIncoming),
112
- if (appStore.wallet!.type == WalletType.bitcoin)
113
- FilterItem(
114
- value: () => transactionFilterStore.displaySilentPayments,
115
- caption: S.current.silent_payments,
116
- onChanged: transactionFilterStore.toggleSilentPayments,
117
- ),
118
- SwapFilterItem(
119
- enabledProviders: () => tradeFilterStore.enabledProviders,
120
- allEnabled: () => tradeFilterStore.displayAllTrades,
121
- value: () => tradeFilterStore.enabledProviders>0,
122
- onChanged: () =>
123
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.all)),
124
- FilterItem(
125
- value: () => orderFilterStore.displayCakePay,
126
- caption: 'Cake Pay',
127
- onChanged: () =>
128
- orderFilterStore.toggleDisplayOrder(OrderProviderDescription.cakePay)),
129
- ],
130
- exchangeFilterItems = [
131
- SwapProviderFilterItem(
132
- providerDescription: ExchangeProviderDescription.changeNow,
133
- value: () => tradeFilterStore.displayChangeNow,
134
- onChanged: () =>
135
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.changeNow)),
136
- SwapProviderFilterItem(
137
- providerDescription: ExchangeProviderDescription.sideShift,
138
- value: () => tradeFilterStore.displaySideShift,
139
- onChanged: () =>
140
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.sideShift)),
141
- SwapProviderFilterItem(
142
- providerDescription: ExchangeProviderDescription.simpleSwap,
143
- value: () => tradeFilterStore.displaySimpleSwap,
144
- onChanged: () =>
145
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.simpleSwap)),
146
- SwapProviderFilterItem(
147
- providerDescription: ExchangeProviderDescription.trocador,
148
- value: () => tradeFilterStore.displayTrocador,
149
- onChanged: () =>
150
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.trocador)),
151
- SwapProviderFilterItem(
152
- providerDescription: ExchangeProviderDescription.exolix,
153
- value: () => tradeFilterStore.displayExolix,
154
- onChanged: () =>
155
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.exolix)),
156
- SwapProviderFilterItem(
157
- providerDescription: ExchangeProviderDescription.chainflip,
158
- value: () => tradeFilterStore.displayChainflip,
159
- onChanged: () =>
160
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.chainflip)),
161
- SwapProviderFilterItem(
162
- providerDescription: ExchangeProviderDescription.thorChain,
163
- value: () => tradeFilterStore.displayThorChain,
164
- onChanged: () =>
165
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.thorChain)),
166
- SwapProviderFilterItem(
167
- providerDescription: ExchangeProviderDescription.letsExchange,
168
- value: () => tradeFilterStore.displayLetsExchange,
169
- onChanged: () =>
170
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.letsExchange)),
171
- SwapProviderFilterItem(
172
- providerDescription: ExchangeProviderDescription.stealthEx,
173
- value: () => tradeFilterStore.displayStealthEx,
174
- onChanged: () =>
175
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.stealthEx)),
176
- SwapProviderFilterItem(
177
- providerDescription: ExchangeProviderDescription.xoSwap,
178
- value: () => tradeFilterStore.displayXOSwap,
179
- onChanged: () =>
180
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.xoSwap)),
181
- SwapProviderFilterItem(
182
- providerDescription: ExchangeProviderDescription.swapTrade,
183
- value: () => tradeFilterStore.displaySwapTrade,
184
- onChanged: () =>
185
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.swapTrade)),
186
- SwapProviderFilterItem(
187
- providerDescription: ExchangeProviderDescription.swapsXyz,
188
- value: () => tradeFilterStore.displaySwapXyz,
189
- onChanged: () =>
190
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.swapsXyz)),
191
- SwapProviderFilterItem(
192
- providerDescription: ExchangeProviderDescription.nearIntents,
193
- value: () => tradeFilterStore.displayNearIntents,
194
- onChanged: () =>
195
- tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.nearIntents)),
196
- ],
99
+ filterItems = [],
100
+ exchangeFilterItems = [],
101
subname = '',
102
name = appStore.wallet!.name,
103
type = appStore.wallet!.type,
@@ -214,6 +118,8 @@ abstract class DashboardViewModelBase with Store {
118
unawaited(_loadConstraints());
119
final _wallet = wallet;
120
121
+ loadFilterItems();
122
+
123
if (_wallet.type == WalletType.monero) {
124
subname = monero!.getCurrentAccount(_wallet).label;
125
@@ -346,6 +252,110 @@ abstract class DashboardViewModelBase with Store {
252
tradeMonitor.monitorActiveTrades(wallet.id);
253
}
254
255
+
256
+ void loadFilterItems() {
257
+ filterItems = [
258
+ // FilterItem(
259
+ // value: () => transactionFilterStore.displayAll,
260
+ // caption: S.current.all_transactions,
261
+ // onChanged: transactionFilterStore.toggleAll),
262
+ FilterItem(
263
+ value: () => transactionFilterStore.displayOutgoing,
264
+ caption: S.current.send,
265
+ onChanged: transactionFilterStore.toggleOutgoing),
266
+ FilterItem(
267
+ value: () => transactionFilterStore.displayIncoming,
268
+ caption: S.current.receive,
269
+ onChanged: transactionFilterStore.toggleIncoming),
270
+ if (appStore.wallet!.type == WalletType.bitcoin)
271
+ FilterItem(
272
+ value: () => transactionFilterStore.displaySilentPayments,
273
+ caption: S.current.silent_payments,
274
+ onChanged: transactionFilterStore.toggleSilentPayments,
275
+ ),
276
+ SwapFilterItem(
277
+ enabledProviders: () => tradeFilterStore.enabledProviders,
278
+ allEnabled: () => tradeFilterStore.displayAllTrades,
279
+ value: () => tradeFilterStore.enabledProviders>0,
280
+ onChanged: () =>
281
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.all)),
282
+ FilterItem(
283
+ value: () => orderFilterStore.displayCakePay,
284
+ caption: 'Cake Pay',
285
+ onChanged: () =>
286
+ orderFilterStore.toggleDisplayOrder(OrderProviderDescription.cakePay)),
287
+ ];
288
+ exchangeFilterItems = [
289
+ SwapProviderFilterItem(
290
+ providerDescription: ExchangeProviderDescription.changeNow,
291
+ value: () => tradeFilterStore.displayChangeNow,
292
+ onChanged: () =>
293
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.changeNow)),
294
+ SwapProviderFilterItem(
295
+ providerDescription: ExchangeProviderDescription.sideShift,
296
+ value: () => tradeFilterStore.displaySideShift,
297
+ onChanged: () =>
298
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.sideShift)),
299
+ SwapProviderFilterItem(
300
+ providerDescription: ExchangeProviderDescription.simpleSwap,
301
+ value: () => tradeFilterStore.displaySimpleSwap,
302
+ onChanged: () =>
303
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.simpleSwap)),
304
+ SwapProviderFilterItem(
305
+ providerDescription: ExchangeProviderDescription.trocador,
306
+ value: () => tradeFilterStore.displayTrocador,
307
+ onChanged: () =>
308
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.trocador)),
309
+ SwapProviderFilterItem(
310
+ providerDescription: ExchangeProviderDescription.exolix,
311
+ value: () => tradeFilterStore.displayExolix,
312
+ onChanged: () =>
313
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.exolix)),
314
+ SwapProviderFilterItem(
315
+ providerDescription: ExchangeProviderDescription.chainflip,
316
+ value: () => tradeFilterStore.displayChainflip,
317
+ onChanged: () =>
318
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.chainflip)),
319
+ SwapProviderFilterItem(
320
+ providerDescription: ExchangeProviderDescription.thorChain,
321
+ value: () => tradeFilterStore.displayThorChain,
322
+ onChanged: () =>
323
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.thorChain)),
324
+ SwapProviderFilterItem(
325
+ providerDescription: ExchangeProviderDescription.letsExchange,
326
+ value: () => tradeFilterStore.displayLetsExchange,
327
+ onChanged: () =>
328
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.letsExchange)),
329
+ SwapProviderFilterItem(
330
+ providerDescription: ExchangeProviderDescription.stealthEx,
331
+ value: () => tradeFilterStore.displayStealthEx,
332
+ onChanged: () =>
333
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.stealthEx)),
334
+ SwapProviderFilterItem(
335
+ providerDescription: ExchangeProviderDescription.xoSwap,
336
+ value: () => tradeFilterStore.displayXOSwap,
337
+ onChanged: () =>
338
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.xoSwap)),
339
+ SwapProviderFilterItem(
340
+ providerDescription: ExchangeProviderDescription.swapTrade,
341
+ value: () => tradeFilterStore.displaySwapTrade,
342
+ onChanged: () =>
343
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.swapTrade)),
344
+ SwapProviderFilterItem(
345
+ providerDescription: ExchangeProviderDescription.swapsXyz,
346
+ value: () => tradeFilterStore.displaySwapXyz,
347
+ onChanged: () =>
348
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.swapsXyz)),
349
+ SwapProviderFilterItem(
350
+ providerDescription: ExchangeProviderDescription.nearIntents,
351
+ value: () => tradeFilterStore.displayNearIntents,
352
+ onChanged: () =>
353
+ tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.nearIntents)),
354
+ ];
355
+ }
356
+
357
+
358
+
359
bool _isTransactionDisposerCallbackRunning = false;
360
361
@action
@@ -1254,6 +1264,7 @@ abstract class DashboardViewModelBase with Store {
1264
this.wallet = wallet;
1265
type = wallet.type;
1266
name = wallet.name;
1267
+ loadFilterItems();
1268
1269
if (wallet.type == WalletType.monero) {
1270
subname = monero!.getCurrentAccount(wallet).label;