diff --git a/src/routes/watchlist/stocks/+page.svelte b/src/routes/watchlist/stocks/+page.svelte index d0c5bd36..b60f7de0 100644 --- a/src/routes/watchlist/stocks/+page.svelte +++ b/src/routes/watchlist/stocks/+page.svelte @@ -288,11 +288,15 @@ async function handleAddTicker(event, ticker) { // Ensure inputValue is reset inputValue = ''; - // Check if the ticker is already in the watchList; if not, add it - if (!watchList.includes(ticker)) { - watchList = [...watchList, ticker]; // Add ticker to watchlist - } +if (!watchList.some(item => item.symbol === ticker)) { +} else { + toast.error(`This symbol is already in your watchlist`, { + style: 'border-radius: 10px; background: #333; color: #fff; padding: 12px; margin-top: 10px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);', + }); + return +} + // Exit edit mode editMode = false;