Skip to content

Commit 496db83

Browse files
committed
fix: use correct sonner API for toast notifications in Math preferences
1 parent c72502f commit 496db83

File tree

1 file changed

+17
-5
lines changed
  • src/renderer/components/preferences

1 file changed

+17
-5
lines changed

src/renderer/components/preferences/Math.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '@/composables/math-notebook/math-engine/format'
1010
import { i18n, ipc, store } from '@/electron'
1111
12-
const { toast } = useSonner()
12+
const { sonner } = useSonner()
1313
1414
const settings = reactive(store.preferences.get('math') as MathSettings)
1515
@@ -83,10 +83,16 @@ async function refreshFiatRates() {
8383
isRefreshingFiat.value = true
8484
try {
8585
await ipc.invoke('system:currency-rates-refresh', null)
86-
toast(i18n.t('preferences:math.currencyRates.refreshed'))
86+
sonner({
87+
message: i18n.t('preferences:math.currencyRates.refreshed'),
88+
type: 'success',
89+
})
8790
}
8891
catch {
89-
toast(i18n.t('preferences:math.currencyRates.refreshError'))
92+
sonner({
93+
message: i18n.t('preferences:math.currencyRates.refreshError'),
94+
type: 'error',
95+
})
9096
}
9197
finally {
9298
isRefreshingFiat.value = false
@@ -97,10 +103,16 @@ async function refreshCryptoRates() {
97103
isRefreshingCrypto.value = true
98104
try {
99105
await ipc.invoke('system:crypto-rates-refresh', null)
100-
toast(i18n.t('preferences:math.cryptoRates.refreshed'))
106+
sonner({
107+
message: i18n.t('preferences:math.cryptoRates.refreshed'),
108+
type: 'success',
109+
})
101110
}
102111
catch {
103-
toast(i18n.t('preferences:math.cryptoRates.rateLimited'))
112+
sonner({
113+
message: i18n.t('preferences:math.cryptoRates.rateLimited'),
114+
type: 'error',
115+
})
104116
}
105117
finally {
106118
isRefreshingCrypto.value = false

0 commit comments

Comments
 (0)