update export button

This commit is contained in:
MuslemRahimi 2024-09-28 21:47:29 +02:00
parent dd13f00855
commit b9a644c097
3 changed files with 5 additions and 6 deletions

View File

@ -2,8 +2,7 @@
<script lang ='ts'>
import { displayCompanyName, trendAnalysisComponent, stockTicker, etfTicker, cryptoTicker, assetType, getCache, setCache} from '$lib/store';
import InfoModal from '$lib/components/InfoModal.svelte';
//import Chart from '$lib/components/Chart.svelte';
//import Lazy from 'svelte-lazy';
let trendList = [];
let isLoaded = false;

View File

@ -720,7 +720,7 @@ async function initializePrice() {
async function exportData() {
let exportList = [];
if(data?.user?.tier === 'Pro') {
if(data?.user) {
const response = await fetch("/api/historical-price", {
method: "POST",
headers: {
@ -764,7 +764,7 @@ async function exportData() {
document.body.removeChild(a);
} else {
toast.error('Only for Pro Members', {
toast.error('Please Sign In', {
style: 'border-radius: 200px; background: #333; color: #fff;'
});
}

View File

@ -596,7 +596,7 @@ async function historicalPrice(timePeriod: string) {
async function exportData() {
let exportList = [];
if(data?.user?.tier === 'Pro') {
if(data?.user) {
const response = await fetch("/api/historical-price", {
method: "POST",
headers: {
@ -640,7 +640,7 @@ async function exportData() {
document.body.removeChild(a);
} else {
toast.error('Only for Pro Members', {
toast.error('Please Sign In', {
style: 'border-radius: 200px; background: #333; color: #fff;'
});
}