Skip to content

Commit

Permalink
update notifier negative method
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Nov 22, 2024
1 parent 981e3c9 commit 10d4e10
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/lib/Notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function useNotifications() {
$q.notify(options)
}

function negative(message: string): void {
function error(message: string): void {
$q.notify({ color: 'negative', message: message })
}

Expand All @@ -40,5 +40,5 @@ export default function useNotifications() {
$q.notify({ color: 'positive', message: message })
}

return { custom, info, negative, neutral, success }
return { custom, info, error, neutral, success }
}
8 changes: 4 additions & 4 deletions src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import { engine } from '../lib/AssetAllocation'
import appService from '../appService'
import { CurlyBraces, HelpCircle, MoreVertical } from 'lucide-vue-next'
const Notification = useNotifications()
const Notifier = useNotifications()
const $router = useRouter()
const $q = useQuasar()
Expand Down Expand Up @@ -198,7 +198,7 @@ async function onConfirmRestore() {
const records = JSON.parse(contents)
await db.settings.bulkAdd(records)
Notification.positive('Settings imported')
Notifier.success('Settings imported')
await loadSettings()
}
Expand Down Expand Up @@ -268,10 +268,10 @@ async function onSchTxMigrationClick() {
//schTxs
result = await appService.db.scheduled.bulkPut(schTxs)
} catch (error: any) {
Notification.negative(error)
Notifier.error(error)
}
Notification.info(
Notifier.info(
counter +
' SchTx Transaction records converted from JSON to objects.' +
result
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Sync.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ async function onConnectClicked() {
Notifier.success(response)
} catch (error: any) {
console.error(error)
Notifier.negative('Connecting to CashierSync: ' + error.message)
Notifier.error('Connecting to CashierSync: ' + error.message)
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ async function synchronizeAaValues() {
Notifier.success('Asset Allocation values loaded')
} catch (error: any) {
console.error(error)
Notifier.negative(error.message)
Notifier.error(error.message)
}
}
Expand All @@ -181,15 +181,15 @@ async function synchronizeAccounts() {
const report = await sync.readAccounts()
if (!report || report.length == 0) {
Notifier.negative('Invalid response received: ' + report)
Notifier.error('Invalid response received: ' + report)
return
}
// delete all accounts only after we have retrieved the new ones.
await appService.deleteAccounts()
await appService.importBalanceSheet(report)
Notifier.success('accounts fetched from Ledger')
Notifier.success('Accounts fetched from Ledger')
}
async function onSyncClicked() {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function onSyncClicked() {
} catch (error: any) {
console.error(error)
Notifier.negative(error.message)
Notifier.error(error.message)
// reset all progress indicators
showAccountProgress.value = false
Expand All @@ -235,7 +235,7 @@ async function synchronizePayees() {
const response = await sync.readPayees()
if (!response || response.length == 0) {
Notifier.negative('Invalid response received: ' + response)
Notifier.error('Invalid response received: ' + response)
return
}
Expand All @@ -254,7 +254,7 @@ async function shutdown() {
await sync.shutdown()
} catch (error: any) {
console.error(error)
Notifier.negative(error.message)
Notifier.error(error.message)
}
Notifier.neutral('The server shutdown request sent.')
Expand Down

0 comments on commit 10d4e10

Please sign in to comment.