show zap pool notification only if wallet is ready
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2024-01-10 16:27:19 +02:00
parent 9e2582ac81
commit 93608f817f
2 changed files with 6 additions and 2 deletions

View File

@ -2,12 +2,13 @@ import { FormattedMessage, FormattedNumber } from "react-intl";
import { Link } from "react-router-dom";
import { BaseUITask } from "@/Components/Tasks/index";
import { Wallets } from "@/Wallet";
export class NoticeZapPoolDefault extends BaseUITask {
id = "zap-pool-default";
check(): boolean {
return !this.state.muted && CONFIG.defaultZapPoolFee !== undefined;
return !this.state.muted && CONFIG.defaultZapPoolFee !== 0 && !!Wallets.snapshot().wallet?.isReady();
}
render() {

View File

@ -20,7 +20,10 @@ class TaskStore extends ExternalStore<Array<UITask>> {
constructor() {
super();
const AllTasks: Array<UITask> = [new BackupKeyTask(), new Nip5Task(), new DonateTask(), new NoticeZapPoolDefault()];
const AllTasks: Array<UITask> = [new BackupKeyTask(), new Nip5Task(), new DonateTask()];
if (CONFIG.features.zapPool) {
AllTasks.push(new NoticeZapPoolDefault());
}
if (CONFIG.features.subscriptions) {
AllTasks.push(new RenewSubTask());
}