forked from Kieran/snort
show zap pool notification only if wallet is ready
This commit is contained in:
parent
9e2582ac81
commit
93608f817f
@ -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() {
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user