Skip to content

Commit c4d30e1

Browse files
committed
add toast ids
1 parent 1d0f261 commit c4d30e1

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

Bitkit/ViewModels/AppViewModel.swift

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,29 @@ class AppViewModel: ObservableObject {
120120
toast(
121121
type: .error,
122122
title: t("other__scan_err_decoding"),
123-
description: t("other__scan__error__generic")
123+
description: t("other__scan__error__generic"),
124+
accessibilityIdentifier: "InvalidAddressToast"
124125
)
125126
case .insufficientSavings:
126127
toast(
127128
type: .error,
128129
title: t("other__pay_insufficient_savings"),
129-
description: t("other__pay_insufficient_savings_description")
130+
description: t("other__pay_insufficient_savings_description"),
131+
accessibilityIdentifier: "InsufficientSavingsToast"
130132
)
131133
case .insufficientSpending:
132134
toast(
133135
type: .error,
134136
title: t("other__pay_insufficient_spending"),
135-
description: t("other__pay_insufficient_savings_description")
137+
description: t("other__pay_insufficient_savings_description"),
138+
accessibilityIdentifier: "InsufficientSpendingToast"
136139
)
137140
case .expiredLightningOnly:
138141
toast(
139142
type: .error,
140143
title: t("other__scan_err_decoding"),
141-
description: t("other__scan__error__expired")
144+
description: t("other__scan__error__expired"),
145+
accessibilityIdentifier: "ExpiredLightningToast"
142146
)
143147
case .valid, .empty:
144148
break
@@ -237,7 +241,8 @@ extension AppViewModel {
237241
toast(
238242
type: .error,
239243
title: t("other__scan_err_decoding"),
240-
description: t("other__scan__error__generic")
244+
description: t("other__scan__error__generic"),
245+
accessibilityIdentifier: "InvalidAddressToast"
241246
)
242247
return
243248
}
@@ -278,7 +283,8 @@ extension AppViewModel {
278283
description: t(
279284
"other__pay_insufficient_savings_amount_description",
280285
variables: ["amount": CurrencyFormatter.formatSats(amountNeeded)]
281-
)
286+
),
287+
accessibilityIdentifier: "InsufficientSavingsToast"
282288
)
283289
return
284290
}
@@ -288,7 +294,8 @@ extension AppViewModel {
288294
toast(
289295
type: .error,
290296
title: t("other__pay_insufficient_savings"),
291-
description: t("other__pay_insufficient_savings_description")
297+
description: t("other__pay_insufficient_savings_description"),
298+
accessibilityIdentifier: "InsufficientSavingsToast"
292299
)
293300
return
294301
}
@@ -302,7 +309,8 @@ extension AppViewModel {
302309
toast(
303310
type: .error,
304311
title: t("other__scan_err_decoding"),
305-
description: t("other__scan__error__generic")
312+
description: t("other__scan__error__generic"),
313+
accessibilityIdentifier: "InvalidAddressToast"
306314
)
307315
return
308316
}
@@ -321,13 +329,19 @@ extension AppViewModel {
321329
toast(
322330
type: .error,
323331
title: t("other__pay_insufficient_spending"),
324-
description: description
332+
description: description,
333+
accessibilityIdentifier: "InsufficientSpendingToast"
325334
)
326335
return
327336
}
328337

329338
guard !invoice.isExpired else {
330-
toast(type: .error, title: t("other__scan_err_decoding"), description: t("other__scan__error__expired"))
339+
toast(
340+
type: .error,
341+
title: t("other__scan_err_decoding"),
342+
description: t("other__scan__error__expired"),
343+
accessibilityIdentifier: "ExpiredLightningToast"
344+
)
331345
return
332346
}
333347

@@ -356,7 +370,8 @@ extension AppViewModel {
356370
toast(
357371
type: .error,
358372
title: t("other__scan_err_decoding"),
359-
description: t("other__scan__error__generic")
373+
description: t("other__scan__error__generic"),
374+
accessibilityIdentifier: "InvalidAddressToast"
360375
)
361376
return
362377
}

0 commit comments

Comments
 (0)