Improve prompt store lang sorting
This commit is contained in:
parent
115f357a07
commit
16c16887ae
|
@ -154,10 +154,10 @@ export const usePromptStore = createPersistStore(
|
|||
fetch(PROMPT_URL)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
let fetchPrompts = [res.en, res.tw, res.cn];
|
||||
if (getLang() === "cn") {
|
||||
fetchPrompts = fetchPrompts.reverse();
|
||||
}
|
||||
const lang = getLang();
|
||||
const fetchPrompts = [res[lang], res.en, res.tw, res.cn].filter(
|
||||
Boolean,
|
||||
);
|
||||
const builtinPrompts = fetchPrompts.map((promptList: PromptList) => {
|
||||
return promptList.map(
|
||||
([title, content]) =>
|
||||
|
|
Loading…
Reference in New Issue