update toast
This commit is contained in:
parent
5588179ac7
commit
94298ec33f
@ -39,12 +39,18 @@
|
|||||||
|
|
||||||
async function sendFeedback() {
|
async function sendFeedback() {
|
||||||
if (inputValue?.length === 0) {
|
if (inputValue?.length === 0) {
|
||||||
toast.error("Please enter your feedback");
|
toast.error("Please enter your feedback", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rating?.length === 0 && category === "general") {
|
if (rating?.length === 0 && category === "general") {
|
||||||
toast.error("Please select an emoji");
|
toast.error("Please select an emoji", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +74,10 @@
|
|||||||
body: JSON.stringify(postData),
|
body: JSON.stringify(postData),
|
||||||
});
|
});
|
||||||
|
|
||||||
toast.success("Thank you for your feedback");
|
toast.success("Thank you for your feedback", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
|
|
||||||
rating = "";
|
rating = "";
|
||||||
inputValue = "";
|
inputValue = "";
|
||||||
|
|||||||
@ -19,15 +19,24 @@
|
|||||||
case "success":
|
case "success":
|
||||||
case "redirect":
|
case "redirect":
|
||||||
isClicked = true;
|
isClicked = true;
|
||||||
toast.success("Login successfully!");
|
toast.success("Login successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Invalid credentials");
|
toast.error("Invalid credentials", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
@ -57,15 +66,24 @@
|
|||||||
case "success":
|
case "success":
|
||||||
case "redirect":
|
case "redirect":
|
||||||
isClicked = true;
|
isClicked = true;
|
||||||
toast.success("Registration successfully!");
|
toast.success("Registration successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Invalid credentials");
|
toast.error("Invalid credentials", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
|
|||||||
@ -18,7 +18,10 @@
|
|||||||
async function handleCreateAlert() {
|
async function handleCreateAlert() {
|
||||||
// Validate input locally.
|
// Validate input locally.
|
||||||
if (targetPrice < 0) {
|
if (targetPrice < 0) {
|
||||||
toast.error("Target Price must be above zero");
|
toast.error("Target Price must be above zero", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,18 +57,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Use toast.promise to handle pending, success, and error states.
|
// Use toast.promise to handle pending, success, and error states.
|
||||||
toast.promise(
|
toast.promise(promise, {
|
||||||
promise,
|
|
||||||
{
|
|
||||||
loading: "Creating price alert...",
|
loading: "Creating price alert...",
|
||||||
success: "Successfully created price alert",
|
success: "Successfully created price alert",
|
||||||
error: (err) => err.message || "Failed to create price alert",
|
error: (err) => err.message || "Failed to create price alert",
|
||||||
},
|
|
||||||
{
|
|
||||||
style:
|
style:
|
||||||
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
// Await the promise and handle the result.
|
// Await the promise and handle the result.
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -13,8 +13,9 @@
|
|||||||
.then(() => console.log("Content shared successfully."))
|
.then(() => console.log("Content shared successfully."))
|
||||||
.catch((error) => console.log("Error sharing content:", error));
|
.catch((error) => console.log("Error sharing content:", error));
|
||||||
} else {
|
} else {
|
||||||
toast.error("Sharing is not supported by your device", {
|
toast?.error("Sharing is not supported by your device", {
|
||||||
style: "background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,10 @@
|
|||||||
// Handle the error appropriately (e.g., show an error message to the user)
|
// Handle the error appropriately (e.g., show an error message to the user)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toast.error("Only for Pro Members");
|
toast.error("Only for Pro Members", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -269,7 +269,8 @@
|
|||||||
saveRules();
|
saveRules();
|
||||||
} else {
|
} else {
|
||||||
toast.error("Only for Pro Members", {
|
toast.error("Only for Pro Members", {
|
||||||
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1193,7 +1193,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
<Toaster position="bottom-center" />
|
<Toaster position="top-center" />
|
||||||
{#if Cookie && $showCookieConsent === true}
|
{#if Cookie && $showCookieConsent === true}
|
||||||
<Cookie />
|
<Cookie />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@ -163,7 +163,8 @@
|
|||||||
function handleAddRule() {
|
function handleAddRule() {
|
||||||
if (ruleName === "") {
|
if (ruleName === "") {
|
||||||
toast.error("Please select a rule", {
|
toast.error("Please select a rule", {
|
||||||
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -220,11 +221,6 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ruleOfList = [...ruleOfList, newRule];
|
ruleOfList = [...ruleOfList, newRule];
|
||||||
/*
|
|
||||||
toast.success('Rule added', {
|
|
||||||
style: 'border-radius: 200px; background: #2A2E39; color: #fff;'
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
shouldLoadWorker.set(true);
|
shouldLoadWorker.set(true);
|
||||||
}
|
}
|
||||||
@ -444,7 +440,8 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toast.error(`Market is closed`, {
|
toast.error(`Market is closed`, {
|
||||||
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,8 @@
|
|||||||
?.catch((error) => console.log("Error sharing content:", error));
|
?.catch((error) => console.log("Error sharing content:", error));
|
||||||
} else {
|
} else {
|
||||||
toast.error("Sharing is not supported by your device", {
|
toast.error("Sharing is not supported by your device", {
|
||||||
style: "background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,10 @@
|
|||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error loading heatmap:", error);
|
console.error("Error loading heatmap:", error);
|
||||||
toast.error("Failed to load heatmap. Please try again.");
|
toast.error("Failed to load heatmap. Please try again.", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,8 @@
|
|||||||
?.catch((error) => console.log("Error sharing content:", error));
|
?.catch((error) => console.log("Error sharing content:", error));
|
||||||
} else {
|
} else {
|
||||||
toast.error("Sharing is not supported by your device", {
|
toast.error("Sharing is not supported by your device", {
|
||||||
style: "background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,21 +24,33 @@
|
|||||||
break;
|
break;
|
||||||
} else form?.notVerified === false;
|
} else form?.notVerified === false;
|
||||||
{
|
{
|
||||||
toast.success("Login successfully!");
|
toast.success("Login successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "redirect":
|
case "redirect":
|
||||||
isClicked = true;
|
isClicked = true;
|
||||||
toast.success("Login successfully!");
|
toast.success("Login successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Invalid credentials");
|
toast.error("Invalid credentials", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
|
|||||||
@ -229,7 +229,10 @@
|
|||||||
|
|
||||||
function handleAddRule() {
|
function handleAddRule() {
|
||||||
if (ruleName === "") {
|
if (ruleName === "") {
|
||||||
toast.error("Please select a rule");
|
toast.error("Please select a rule", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +511,10 @@
|
|||||||
shouldLoadWorker.set(true);
|
shouldLoadWorker.set(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toast.error(`Market is closed`);
|
toast.error(`Market is closed`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,7 +779,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toast.error("Only for Pro Members");
|
toast.error("Only for Pro Members", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -83,9 +83,15 @@
|
|||||||
|
|
||||||
async function handleDeleteTickers() {
|
async function handleDeleteTickers() {
|
||||||
if (numberOfChecked === 0) {
|
if (numberOfChecked === 0) {
|
||||||
toast.error(`You need to select symbols before you can delete them`);
|
toast.error(`You need to select symbols before you can delete them`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
toast.success(`Price alerts deleted successfully`);
|
toast.success(`Price alerts deleted successfully`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
|
|
||||||
const symbolsToDelete = priceAlertList
|
const symbolsToDelete = priceAlertList
|
||||||
?.filter((item) => deletePriceAlertList.includes(item.id))
|
?.filter((item) => deletePriceAlertList.includes(item.id))
|
||||||
|
|||||||
@ -412,7 +412,7 @@
|
|||||||
class="w-28 transform ease-in-out duration-300"
|
class="w-28 transform ease-in-out duration-300"
|
||||||
style="transform: rotate(23deg);"
|
style="transform: rotate(23deg);"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
alt="pro tier"
|
alt="Pro tier Logo"
|
||||||
/>
|
/>
|
||||||
<h2 class="text-4xl font-bold text-white">Pro Tier</h2>
|
<h2 class="text-4xl font-bold text-white">Pro Tier</h2>
|
||||||
</div>
|
</div>
|
||||||
@ -680,6 +680,34 @@
|
|||||||
>Realtime Dark Pool Data</span
|
>Realtime Dark Pool Data</span
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="flex items-center space-x-3">
|
||||||
|
<!-- Icon -->
|
||||||
|
<svg
|
||||||
|
class="shrink-0 w-5 h-5"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 48 48"
|
||||||
|
><mask id="ipSSuccess0"
|
||||||
|
><g
|
||||||
|
fill="none"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="4"
|
||||||
|
><path
|
||||||
|
fill="#fff"
|
||||||
|
stroke="#fff"
|
||||||
|
d="m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012L24 4Z"
|
||||||
|
/><path stroke="#09090B" d="m17 24l5 5l10-10" /></g
|
||||||
|
></mask
|
||||||
|
><path
|
||||||
|
fill="#00FC50"
|
||||||
|
d="M0 0h48v48H0z"
|
||||||
|
mask="url(#ipSSuccess0)"
|
||||||
|
/></svg
|
||||||
|
>
|
||||||
|
<span class="text-white text-[1rem] font-semibold"
|
||||||
|
>Priority Support</span
|
||||||
|
>
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<div class="m-auto w-full text-white text-sm mb-6">
|
<div class="m-auto w-full text-white text-sm mb-6">
|
||||||
@ -748,7 +776,7 @@
|
|||||||
</label>
|
</label>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="m-auto w-full text-white text-[¹rem] mt-4">
|
<div class="m-auto w-full text-white text-[1rem] mt-4">
|
||||||
30 Day Money Back Guarantee
|
30 Day Money Back Guarantee
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -38,19 +38,31 @@
|
|||||||
return async ({ result, update }) => {
|
return async ({ result, update }) => {
|
||||||
switch (result.type) {
|
switch (result.type) {
|
||||||
case "success":
|
case "success":
|
||||||
toast.success("Subscription Cancelled successfully!");
|
toast.success("Subscription Cancelled successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "redirect":
|
case "redirect":
|
||||||
toast.success("Subscription Cancelled successfully!");
|
toast.success("Subscription Cancelled successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Something went wrong.");
|
toast.error("Something went wrong.", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
@ -72,19 +84,31 @@
|
|||||||
return async ({ result, update }) => {
|
return async ({ result, update }) => {
|
||||||
switch (result.type) {
|
switch (result.type) {
|
||||||
case "success":
|
case "success":
|
||||||
toast.success("Subscription Reactivate successfully!");
|
toast.success("Subscription Reactivate successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "redirect":
|
case "redirect":
|
||||||
toast.success("Subscription Reactivate successfully!");
|
toast.success("Subscription Reactivate successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Something went wrong.");
|
toast.error("Something went wrong.", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
@ -106,19 +130,31 @@
|
|||||||
return async ({ result, update }) => {
|
return async ({ result, update }) => {
|
||||||
switch (result.type) {
|
switch (result.type) {
|
||||||
case "success":
|
case "success":
|
||||||
toast.success("Changing to Annual Plan successfully!");
|
toast.success("Changing to Annual Plan successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "redirect":
|
case "redirect":
|
||||||
toast.success("Changing to Annual Plan successfully!");
|
toast.success("Changing to Annual Plan successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Something went wrong.");
|
toast.error("Something went wrong.", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
@ -161,9 +197,15 @@
|
|||||||
const output = await subscribeUser();
|
const output = await subscribeUser();
|
||||||
if (output?.success === true) {
|
if (output?.success === true) {
|
||||||
isPushSubscribed = true;
|
isPushSubscribed = true;
|
||||||
toast.success("Push notification activated successfully!");
|
toast.success("Push notification activated successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
toast.error("Your browser does not support push notifications...");
|
toast.error("Your browser does not support push notifications...", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
loading = false;
|
loading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,15 +17,24 @@
|
|||||||
case "success":
|
case "success":
|
||||||
case "redirect":
|
case "redirect":
|
||||||
isClicked = true;
|
isClicked = true;
|
||||||
toast.success("Registration successfully!");
|
toast.success("Registration successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "failure":
|
case "failure":
|
||||||
toast.error("Invalid credentials");
|
toast.error("Invalid credentials", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
await update();
|
await update();
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
toast.error(result.error.message);
|
toast.error(result.error.message, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
await update();
|
await update();
|
||||||
|
|||||||
@ -12,16 +12,16 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
try {
|
try {
|
||||||
await pb.collection("users").requestPasswordReset(email);
|
await pb.collection("users").requestPasswordReset(email);
|
||||||
toast.success("Password resetted. Check your emails!");
|
toast.success("Password resetted. Check your emails!", {
|
||||||
goto("/login");
|
|
||||||
} catch (err) {
|
|
||||||
toast.error(
|
|
||||||
{ err },
|
|
||||||
{
|
|
||||||
style:
|
style:
|
||||||
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
},
|
});
|
||||||
);
|
goto("/login");
|
||||||
|
} catch (err) {
|
||||||
|
toast.error(err, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1493,7 +1493,10 @@
|
|||||||
const output = await response.json();
|
const output = await response.json();
|
||||||
|
|
||||||
if (output === "success") {
|
if (output === "success") {
|
||||||
toast.success("Strategy deleted successfully!");
|
toast.success("Strategy deleted successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
|
|
||||||
strategyList =
|
strategyList =
|
||||||
strategyList?.filter((item) => item?.id !== selectedStrategy) ?? [];
|
strategyList?.filter((item) => item?.id !== selectedStrategy) ?? [];
|
||||||
@ -1528,7 +1531,10 @@
|
|||||||
?.map((rule) => [rule.name, new Set(rule.value)]), // Create Map from filtered rules
|
?.map((rule) => [rule.name, new Set(rule.value)]), // Create Map from filtered rules
|
||||||
);
|
);
|
||||||
} else if (output === "failure") {
|
} else if (output === "failure") {
|
||||||
toast.error("Something went wrong. Please try again");
|
toast.error("Something went wrong. Please try again", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1542,12 +1548,18 @@
|
|||||||
const title = formData.get("title");
|
const title = formData.get("title");
|
||||||
|
|
||||||
if (!title || title.length === 0) {
|
if (!title || title.length === 0) {
|
||||||
toast.error("Title cannot be empty!");
|
toast.error("Title cannot be empty!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title?.length > 100) {
|
if (title?.length > 100) {
|
||||||
toast.error("Title is too long. Keep it simple and concise bruv!");
|
toast.error("Title is too long. Keep it simple and concise bruv!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1568,7 +1580,10 @@
|
|||||||
|
|
||||||
const output = await response?.json();
|
const output = await response?.json();
|
||||||
if (output?.id && output?.id?.length !== 0) {
|
if (output?.id && output?.id?.length !== 0) {
|
||||||
toast.success("Strategy created successfully!");
|
toast.success("Strategy created successfully!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
|
|
||||||
const closePopup = document.getElementById("addStrategy");
|
const closePopup = document.getElementById("addStrategy");
|
||||||
closePopup?.dispatchEvent(new MouseEvent("click"));
|
closePopup?.dispatchEvent(new MouseEvent("click"));
|
||||||
@ -1579,7 +1594,10 @@
|
|||||||
strategyList?.unshift(output);
|
strategyList?.unshift(output);
|
||||||
selectedPopularStrategy = "";
|
selectedPopularStrategy = "";
|
||||||
} else {
|
} else {
|
||||||
toast.error("Something went wrong. Please try again later!");
|
toast.error("Something went wrong. Please try again later!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -1692,7 +1710,10 @@
|
|||||||
|
|
||||||
function handleAddRule() {
|
function handleAddRule() {
|
||||||
if (ruleName === "") {
|
if (ruleName === "") {
|
||||||
toast.error("Please select a rule");
|
toast.error("Please select a rule", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1904,7 +1925,10 @@ const handleKeyDown = (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (printToast === true) {
|
if (printToast === true) {
|
||||||
toast.success("Strategy saved!");
|
toast.success("Strategy saved!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//isSaved = true;
|
//isSaved = true;
|
||||||
|
|||||||
@ -63,7 +63,8 @@
|
|||||||
?.catch((error) => console.log("Error sharing content:", error));
|
?.catch((error) => console.log("Error sharing content:", error));
|
||||||
} else {
|
} else {
|
||||||
toast.error("Sharing is not supported by your device", {
|
toast.error("Sharing is not supported by your device", {
|
||||||
style: "background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,14 +50,16 @@
|
|||||||
?.message ?? "";
|
?.message ?? "";
|
||||||
|
|
||||||
toast.error("Invalid credentials", {
|
toast.error("Invalid credentials", {
|
||||||
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Handle other errors
|
// Handle other errors
|
||||||
console.error("Unexpected error during registration:", error);
|
console.error("Unexpected error during registration:", error);
|
||||||
|
|
||||||
toast.error("An unexpected error occurred", {
|
toast.error("An unexpected error occurred", {
|
||||||
style: "border-radius: 200px; background: #2A2E39; color: #fff;",
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,9 +88,15 @@
|
|||||||
|
|
||||||
async function handleDelete() {
|
async function handleDelete() {
|
||||||
if (numberOfChecked === 0) {
|
if (numberOfChecked === 0) {
|
||||||
toast.error(`You need to select symbols before you can delete them`);
|
toast.error(`You need to select symbols before you can delete them`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} else if (data?.getOptionsWatchlist?.id?.length === 0) {
|
} else if (data?.getOptionsWatchlist?.id?.length === 0) {
|
||||||
toast.error(`You need to select symbols before you can delete them`);
|
toast.error(`You need to select symbols before you can delete them`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
optionsWatchlist = optionsWatchlist?.filter(
|
optionsWatchlist = optionsWatchlist?.filter(
|
||||||
(item) => !deleteOptionsId?.includes(item?.id),
|
(item) => !deleteOptionsId?.includes(item?.id),
|
||||||
|
|||||||
@ -297,12 +297,18 @@
|
|||||||
|
|
||||||
// Validate the title input
|
// Validate the title input
|
||||||
if (!title || title.toString().trim().length === 0) {
|
if (!title || title.toString().trim().length === 0) {
|
||||||
toast.error("Title cannot be empty!");
|
toast.error("Title cannot be empty!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title.toString().length > 100) {
|
if (title.toString().length > 100) {
|
||||||
toast.error("Title is too long. Keep it simple and concise bruv!");
|
toast.error("Title is too long. Keep it simple and concise bruv!", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,7 +414,10 @@
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
toast.error("An error occurred. Please try again later.");
|
toast.error("An error occurred. Please try again later.", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +446,10 @@
|
|||||||
|
|
||||||
async function handleDeleteTickers() {
|
async function handleDeleteTickers() {
|
||||||
if (numberOfChecked === 0) {
|
if (numberOfChecked === 0) {
|
||||||
toast.error(`You need to select symbols before you can delete them`);
|
toast.error(`You need to select symbols before you can delete them`, {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
watchList = watchList?.filter(
|
watchList = watchList?.filter(
|
||||||
(item) => !deleteTickerList?.includes(item?.symbol),
|
(item) => !deleteTickerList?.includes(item?.symbol),
|
||||||
@ -501,7 +513,10 @@
|
|||||||
async function handleAddTicker(event, ticker) {
|
async function handleAddTicker(event, ticker) {
|
||||||
// Check if the ticker is already in the watchlist.
|
// Check if the ticker is already in the watchlist.
|
||||||
if (watchList?.some((item) => item?.symbol === ticker)) {
|
if (watchList?.some((item) => item?.symbol === ticker)) {
|
||||||
toast.error("This symbol is already in your watchlist");
|
toast.error("This symbol is already in your watchlist", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
inputValue = "";
|
inputValue = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -536,6 +551,8 @@
|
|||||||
loading: "Updating watchlist...",
|
loading: "Updating watchlist...",
|
||||||
success: "Watchlist updated successfully!",
|
success: "Watchlist updated successfully!",
|
||||||
error: (err) => err.message || "Failed to update watchlist",
|
error: (err) => err.message || "Failed to update watchlist",
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -594,7 +611,10 @@
|
|||||||
|
|
||||||
saveRules();
|
saveRules();
|
||||||
} else {
|
} else {
|
||||||
toast.error("Only for Pro Members");
|
toast.error("Only for Pro Members", {
|
||||||
|
style:
|
||||||
|
"border-radius: 5px; background: #fff; color: #000; border-color: #4B5563; font-size: 15px;",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user