first music free
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user