Skip to content

Commit

Permalink
Error if wallet is not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpolman committed May 23, 2024
1 parent af8ca65 commit 2bc3e1d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ jobs:
DISCORD_WEBHOOK: ${{ env.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "${{ needs.autodeploy.result == 'success' && '✅' || '⛔' }} Released App `${{ env.PACKAGE_VERSION }}`"
args: "${{ needs.autodeploy.result == 'success' && '✅' || '⛔' }} Released App `v${{ env.PACKAGE_VERSION }}-app`"
2 changes: 2 additions & 0 deletions apps/api/src/app/services/PoolService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ async function findParticipants(pool: PoolDocument, page: number, limit: number,

try {
account = accounts.find((a) => a.sub === participant.sub);
if (!account) throw new Error('Account not found');

account.tokens = await Promise.all(
account.tokens.map(async (token: TToken) =>
ParticipantService.findUser(token, { userId: token.userId, guildId: guild && guild.id }),
Expand Down
1 change: 0 additions & 1 deletion apps/api/src/app/services/RewardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import RewardDiscordRoleService from './RewardDiscordRoleService';
import RewardCustomService from './RewardCustomService';
import RewardGalachainService from './RewardGalachainService';
import PoolService from './PoolService';
import WalletService from './WalletService';
import THXService from './THXService';

const serviceMap = {
Expand Down
3 changes: 3 additions & 0 deletions apps/app/src/stores/Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ export const useWalletStore = defineStore('wallet', {
return switchChain(wagmiConfig, { chainId });
},
signMessage(message: string) {
if (!this.account || !this.account.isConnected) {
throw new Error('Please connect your wallet first.');
}
return signMessage(wagmiConfig, { message });
},
async connect() {
Expand Down

0 comments on commit 2bc3e1d

Please sign in to comment.