Skip to content

Commit

Permalink
Merge pull request #49 from ubiquity-os-marketplace/development
Browse files Browse the repository at this point in the history
Merge to main
  • Loading branch information
whilefoo authored Feb 16, 2025
2 parents a89bf8b + a0dde2c commit 7dc9e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions src/adapters/supabase/helpers/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export class Wallet extends Super {
public async upsertWalletAddress(context: Context, address: string) {
const payload = context.payload;

let userData = await this._checkIfUserExists(payload.sender.id);
if (!userData) {
userData = await this._registerNewUser(payload.sender);
}

const registeredWalletData = await this._getRegisteredWalletData(address);

if (!registeredWalletData) {
Expand Down Expand Up @@ -76,15 +81,6 @@ export class Wallet extends Super {
return data as UserRow;
}

private async _getUserData(payload: Context["payload"]) {
let userData = await this._checkIfUserExists(payload.sender.id);
if (!userData) {
const user = payload.sender;
userData = await this._registerNewUser(user);
}
return userData;
}

private async _registerNewUser(user: Context["payload"]["sender"]) {
const { data: userData, error: userError } = await this.supabase
.from("users")
Expand Down

0 comments on commit 7dc9e14

Please sign in to comment.