返回提交历史
Modified
src/controllers/custom/getItemListsController.ts
+2
-2
Modified
src/services/itemDataService.ts
+4
-0
XFEstudio/SpaceNinjaServer
fix(webui): normalize resource names (#3133)
Fixes #3120 Closes #3121 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3133 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
02f71606
代码差异
2 个文件
+6
-2
@@ -1,5 +1,5 @@
1
1
import type { RequestHandler } from "express";
2
import { getDict, getItemName, getString } from "../../services/itemDataService.ts";
2
import { getDict, getItemName, getNormalizedString, getString } from "../../services/itemDataService.ts";
3
3
import type { TRelicQuality } from "warframe-public-export-plus";
4
4
import {
5
5
ExportAbilities,
@@ -213,7 +213,7 @@ const getItemListsController: RequestHandler = (req, response) => {
213
213
}
214
214
}
215
215
for (const [uniqueName, item] of Object.entries(ExportResources)) {
216
let name = getString(item.name, lang);
216
let name = getNormalizedString(item.name, lang);
217
217
if ("dissectionParts" in item) {
218
218
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
219
219
if (item.syndicateTag == "CetusSyndicate") {
@@ -208,6 +208,10 @@ export const getString = (key: string, dict: Record<string, string>): string =>
208
208
return dict[key] ?? key;
209
209
};
210
210
211
export const getNormalizedString = (key: string, dict: Record<string, string>): string => {
212
return getString(key, dict).split("‘").join("'").split("’").join("'").split("\r\n").join(" ");
213
};
214
211
215
export const getKeyChainItems = ({ KeyChain, ChainStage }: IKeyChainRequest): string[] => {
212
216
const chainStages = ExportKeys[KeyChain].chainStages;
213
217
if (!chainStages) {