Skip to content

Commit

Permalink
refactor: improve code reading
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Dec 11, 2024
1 parent ab7820b commit 15050a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/ui/src/composables/useVotingPower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export function useVotingPower() {
}

function getProposalSnapshot(proposal: Proposal): number | null {
return (
(proposal.state === 'pending' &&
const snapshot =
proposal.state === 'pending' &&
!offchainNetworks.includes(proposal.network)
? null
: proposal.snapshot) || getLatestBlock(proposal.network)
);
: proposal.snapshot;

return snapshot || getLatestBlock(proposal.network);
}

function getSnapshot(
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/stores/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const useNotificationsStore = defineStore('notifications', () => {
} else if (!followedSpacesIds.length && refreshNotificationInterval) {
clearInterval(refreshNotificationInterval);
refreshNotificationInterval = 0;
notifications.value = [];
}
},
{ immediate: true }
Expand Down

0 comments on commit 15050a3

Please sign in to comment.