Skip to content

Commit 61bbe56

Browse files
committed
remove undefined checks
1 parent c7c5dbb commit 61bbe56

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
287287
}
288288

289289
const handleSendProposalButtonClick = async () => {
290-
if (
291-
pythProgramClient &&
292-
dataChanges &&
293-
!isMultisigLoading &&
294-
readOnlySquads
295-
) {
290+
if (pythProgramClient && dataChanges && !isMultisigLoading) {
296291
const instructions: TransactionInstruction[] = []
297292
const publisherInPriceStoreInitializationsVerified: PublicKey[] = []
298293

@@ -859,7 +854,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
859854
}
860855

861856
useEffect(() => {
862-
if (readOnlySquads && connection) {
857+
if (connection) {
863858
const provider = new AnchorProvider(
864859
connection,
865860
readOnlySquads.wallet as Wallet,

governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/Proposal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export const Proposal = ({
238238
useEffect(() => {
239239
let isCancelled = false
240240
const fetchInstructions = async () => {
241-
if (proposal && readOnlySquads) {
241+
if (proposal) {
242242
const proposalInstructions = (
243243
await getManyProposalsInstructions(readOnlySquads, [proposal])
244244
)[0]

governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ProposalRow = ({
5252
const element = elementRef.current
5353
const observer = new IntersectionObserver(async (entries) => {
5454
if (entries[0].isIntersecting) {
55-
if (isMultisigLoading || !connection) {
55+
if (isMultisigLoading) {
5656
return
5757
}
5858

@@ -74,7 +74,6 @@ export const ProposalRow = ({
7474
})
7575
}
7676

77-
if (!readOnlySquads) return
7877
// calculate instructions summary
7978
if (!instructions) {
8079
const proposalInstructions = (

governance/xc_admin/packages/xc_admin_frontend/hooks/useMultisig.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export const useMultisig = (): MultisigHookData => {
8585
const fetchData = async () => {
8686
setIsLoading(true)
8787
try {
88-
if (!readOnlySquads) return
8988
if (cancelled) return
9089
const upgradeMultisigAccount = await readOnlySquads.getMultisig(
9190
UPGRADE_MULTISIG[multisigCluster]

0 commit comments

Comments
 (0)