feat: renew sub task

This commit is contained in:
2023-10-18 14:47:45 +01:00
parent 0ba1ba05ac
commit 98c3d901ae
8 changed files with 143 additions and 64 deletions

View File

@ -6,13 +6,17 @@ import Icon from "Icons/Icon";
import { UITask } from "Tasks";
import { DonateTask } from "./DonateTask";
import { Nip5Task } from "./Nip5Task";
import { RenewSubTask } from "./RenewSubscription";
const AllTasks: Array<UITask> = [new Nip5Task(), new DonateTask()];
if (CONFIG.features.subscriptions) {
AllTasks.push(new RenewSubTask());
}
AllTasks.forEach(a => a.load());
export const TaskList = () => {
const publicKey = useLogin().publicKey;
const user = useUserProfile(publicKey);
const session = useLogin();
const user = useUserProfile(session.publicKey);
const [, setTick] = useState<number>(0);
function muteTask(t: UITask) {
@ -22,7 +26,7 @@ export const TaskList = () => {
return (
<>
{AllTasks.filter(a => (user ? a.check(user) : false)).map(a => {
{AllTasks.filter(a => (user ? a.check(user, session) : false)).map(a => {
return (
<div key={a.id} className="card">
<div className="header">