chore: Remove unused code and dependencies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
output: 'export',
|
||||
//output: 'export',
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
|
||||
7584
package-lock.json
generated
7584
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,4 @@
|
||||
"use client";
|
||||
import { addDownload } from "@/lib/db";
|
||||
import { useState, useEffect } from "react";
|
||||
import styled, { keyframes } from "styled-components";
|
||||
import { ny } from "@/lib/utils";
|
||||
@@ -158,7 +157,6 @@ export default function DownloadPage() {
|
||||
window.location.replace(`${BASE_URL}/${releases[releaseTarget]}`);
|
||||
}
|
||||
setHasDownloaded(true);
|
||||
addDownload(releaseTarget);
|
||||
throwConfetti();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
"use server";
|
||||
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabaseUrl = 'https://dmthyedfjzcysoekmyns.supabase.co'
|
||||
const supabaseKey = process.env.SUPABASE_KEY as string;
|
||||
const supabase = createClient(supabaseUrl, supabaseKey);
|
||||
|
||||
export async function addDownload(platform: string) {
|
||||
// Check if the download count for the platform exists
|
||||
const { data, error } = await supabase
|
||||
.from('downloads')
|
||||
.select('count')
|
||||
.eq('platform', platform)
|
||||
// If it doesn't exist, create it
|
||||
console.log(data)
|
||||
if (data?.length === 0 || data === null) {
|
||||
const {data, error} = await supabase
|
||||
.from('downloads')
|
||||
.insert([{ platform, count: 1 }]);
|
||||
if (error) {
|
||||
console.error(error)
|
||||
}
|
||||
} else {
|
||||
// If it exists, increment the count
|
||||
await supabase
|
||||
.from('downloads')
|
||||
.update({ count: data![0].count + 1 })
|
||||
.eq('platform', platform)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user