Skip to content

Commit

Permalink
show min length according to response
Browse files Browse the repository at this point in the history
  • Loading branch information
wizicer committed Apr 5, 2024
1 parent dad5566 commit e52b1ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@
</p>

<p v-if="price.code == 'TooShort'">
During the current operation period of CNS, only names with {{ minLength }} or more characters can be registered
for the time being. In the future, the registration of all names will be gradually opened. Stay tuned!
During the current operation period of CNS, only names with {{ price.arguments?.[0] ?? minLength }} or more
characters can be registered for the time being. In the future, the registration of all names will be gradually
opened. Stay tuned!
</p>

<template v-else-if="resolveAns?.status == 'Found'">
Expand Down
3 changes: 3 additions & 0 deletions src/service/cns-register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface PriceResponse {
success: boolean;
reason?: string;
code?: string;
arguments?: string[];
}

export interface Price {
Expand All @@ -22,6 +23,7 @@ export interface Price {
registrationFee: number;
reason?: string;
code?: string;
arguments?: string[];
}

export interface RegisterResponse {
Expand Down Expand Up @@ -68,6 +70,7 @@ export async function getPrice(name: string, year: number, renew: boolean): Prom
royaltyPercentage: -1,
reason: qresp.reason,
code: qresp.code,
arguments: qresp.arguments
};
} catch (error) {
console.warn(error);

Check warning on line 76 in src/service/cns-register.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected console statement
Expand Down

0 comments on commit e52b1ee

Please sign in to comment.