first music free

This commit is contained in:
2025-10-21 15:29:20 +02:00
parent 59952efc1c
commit 90ad4be673
3 changed files with 25 additions and 2 deletions
+12
View File
@@ -5,6 +5,7 @@ import { createContext, useContext, useGlobal } from "reactn";
import { useCallback, useEffect, useState } from "react";
import { checkIfEmailIsValid } from "../actions/signupActions";
import { showPremiumRequiredAlert } from "../components/Alert";
import firebase, {
arrayRemove,
arrayUnion,
@@ -168,6 +169,17 @@ export default ({ children }) => {
};
const createNewProject = async ({ hasLyrics = false } = {}) => {
const existingProjectsCount = Array.isArray(userProjects)
? userProjects.length
: 0;
const hasUnlimitedCreation = true;
// currentUserDoc?.isPremium; mettre en place en prod
if (!hasUnlimitedCreation && existingProjectsCount >= 1) {
showPremiumRequiredAlert();
return null;
}
try {
await setIsLoading(true);
const payload = {