Skip to content

Commit

Permalink
fix: set a default value which is type string
Browse files Browse the repository at this point in the history
Signed-off-by: Wenhao Ho <[email protected]>
  • Loading branch information
whck6 committed Aug 28, 2024
1 parent 7fa0ead commit 40def46
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/adapters/supabase/helpers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export class User extends Super {

async getWalletByUserId(userId: number, issueNumber: number) {
const { data, error } = (await this.supabase.from("users").select("wallets(*)").eq("id", userId).single()) as { data: { wallets: Wallet }; error: unknown };
if (this.context.config.emptyWalletText) {
return null;
}
if ((error && !data) || !data.wallets?.address) {
this.context.logger.error("No wallet address found", { userId, issueNumber });
if (this.context.config.startRequiresWallet) {
Expand Down
2 changes: 1 addition & 1 deletion src/types/plugin-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const startStopSchema = T.Object(
taskStaleTimeoutDuration: T.String({ default: "30 Days" }),
maxConcurrentTasks: T.Number({ default: 3 }),
startRequiresWallet: T.Boolean({ default: true }),
emptyWalletText: T.Boolean({ default: false }),
emptyWalletText: T.String({ default: "Please set your wallet address with the /wallet command first and try again." }),
},
{
default: {},
Expand Down
2 changes: 1 addition & 1 deletion tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ function createContext(issue: Record<string, unknown>, sender: Record<string, un
taskStaleTimeoutDuration: "30 Days",
maxConcurrentTasks: 3,
startRequiresWallet: false,
emptyWalletText: true,
emptyWalletText: "Please set your wallet address with the /wallet command first and try again.",
},
octokit: new octokit.Octokit(),
eventName: "issue_comment.created" as SupportedEventsU,
Expand Down

0 comments on commit 40def46

Please sign in to comment.