优化取名逻辑
This commit is contained in:
@@ -146,6 +146,7 @@ Page({
|
||||
generateName(payload)
|
||||
.then((response) => {
|
||||
const results = response && Array.isArray(response.results) ? response.results : [];
|
||||
const analysis = response && response.analysis ? response.analysis : null;
|
||||
if (!results.length) {
|
||||
showToast(messages.GENERATION_FAILED);
|
||||
return;
|
||||
@@ -157,7 +158,8 @@ Page({
|
||||
}
|
||||
accumulator.push({
|
||||
name,
|
||||
meaning: item.meaning || item.Meaning || ""
|
||||
meaning: item.meaning || item.Meaning || "",
|
||||
elementReason: item.elementReason || item.ElementReason || ""
|
||||
});
|
||||
return accumulator;
|
||||
}, []);
|
||||
@@ -165,7 +167,10 @@ Page({
|
||||
showToast(messages.GENERATION_FAILED);
|
||||
return;
|
||||
}
|
||||
namingStore.setResults(normalizedResults);
|
||||
namingStore.setResults({
|
||||
results: normalizedResults,
|
||||
analysis
|
||||
});
|
||||
namingStore.incrementQuota();
|
||||
this.updateQuotaState();
|
||||
if (typeof tt !== "undefined" && tt.navigateTo) {
|
||||
|
||||
Reference in New Issue
Block a user