mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-25 06:39:53 -04:00
fix(gui): Fetch alerts only once
This commit is contained in:
parent
23abb13315
commit
8ec58dcb1e
2 changed files with 9 additions and 1 deletions
|
@ -162,7 +162,12 @@ export async function updatePublicRegistry(): Promise<void> {
|
|||
store.dispatch(registryConnectionFailed());
|
||||
logger.error(error, "Error fetching providers");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch all alerts
|
||||
*/
|
||||
export async function updateAlerts(): Promise<void> {
|
||||
try {
|
||||
const alerts = await fetchAlertsViaHttp();
|
||||
store.dispatch(setAlerts(alerts));
|
||||
|
|
|
@ -3,7 +3,7 @@ import { TauriSwapProgressEventWrapper, TauriContextStatusEvent, TauriLogEvent,
|
|||
import { contextStatusEventReceived, receivedCliLog, rpcSetBalance, timelockChangeEventReceived, rpcSetBackgroundRefundState, approvalEventReceived } from "store/features/rpcSlice";
|
||||
import { swapProgressEventReceived } from "store/features/swapSlice";
|
||||
import logger from "utils/logger";
|
||||
import { fetchAllConversations, updatePublicRegistry, updateRates } from "./api";
|
||||
import { fetchAllConversations, updateAlerts, updatePublicRegistry, updateRates } from "./api";
|
||||
import { checkContextAvailability, getSwapInfo, initializeContext, updateAllNodeStatuses } from "./rpc";
|
||||
import { store } from "./store/storeRenderer";
|
||||
|
||||
|
@ -31,6 +31,9 @@ export async function setupBackgroundTasks(): Promise<void> {
|
|||
setIntervalImmediate(updateRates, UPDATE_RATE_INTERVAL);
|
||||
setIntervalImmediate(fetchAllConversations, FETCH_CONVERSATIONS_INTERVAL);
|
||||
|
||||
// Fetch all alerts
|
||||
updateAlerts();
|
||||
|
||||
// // Setup Tauri event listeners
|
||||
|
||||
// Check if the context is already available. This is to prevent unnecessary re-initialization
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue