update export button
This commit is contained in:
parent
dd13f00855
commit
b9a644c097
@ -2,8 +2,7 @@
|
|||||||
<script lang ='ts'>
|
<script lang ='ts'>
|
||||||
import { displayCompanyName, trendAnalysisComponent, stockTicker, etfTicker, cryptoTicker, assetType, getCache, setCache} from '$lib/store';
|
import { displayCompanyName, trendAnalysisComponent, stockTicker, etfTicker, cryptoTicker, assetType, getCache, setCache} from '$lib/store';
|
||||||
import InfoModal from '$lib/components/InfoModal.svelte';
|
import InfoModal from '$lib/components/InfoModal.svelte';
|
||||||
//import Chart from '$lib/components/Chart.svelte';
|
|
||||||
//import Lazy from 'svelte-lazy';
|
|
||||||
|
|
||||||
let trendList = [];
|
let trendList = [];
|
||||||
let isLoaded = false;
|
let isLoaded = false;
|
||||||
|
|||||||
@ -720,7 +720,7 @@ async function initializePrice() {
|
|||||||
|
|
||||||
async function exportData() {
|
async function exportData() {
|
||||||
let exportList = [];
|
let exportList = [];
|
||||||
if(data?.user?.tier === 'Pro') {
|
if(data?.user) {
|
||||||
const response = await fetch("/api/historical-price", {
|
const response = await fetch("/api/historical-price", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@ -764,7 +764,7 @@ async function exportData() {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toast.error('Only for Pro Members', {
|
toast.error('Please Sign In', {
|
||||||
style: 'border-radius: 200px; background: #333; color: #fff;'
|
style: 'border-radius: 200px; background: #333; color: #fff;'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -596,7 +596,7 @@ async function historicalPrice(timePeriod: string) {
|
|||||||
|
|
||||||
async function exportData() {
|
async function exportData() {
|
||||||
let exportList = [];
|
let exportList = [];
|
||||||
if(data?.user?.tier === 'Pro') {
|
if(data?.user) {
|
||||||
const response = await fetch("/api/historical-price", {
|
const response = await fetch("/api/historical-price", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@ -640,7 +640,7 @@ async function exportData() {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toast.error('Only for Pro Members', {
|
toast.error('Please Sign In', {
|
||||||
style: 'border-radius: 200px; background: #333; color: #fff;'
|
style: 'border-radius: 200px; background: #333; color: #fff;'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user