mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
setting to empty array when empty string
This commit is contained in:
parent
f0dca0cf13
commit
c55f322616
1 changed files with 4 additions and 3 deletions
|
|
@ -79,9 +79,10 @@ $(".pageTest").on("click", ".tags .editTagsButton", () => {
|
|||
const resultid = $(".pageTest .tags .editTagsButton").attr(
|
||||
"result-id"
|
||||
) as string;
|
||||
const tags = $(".pageTest .tags .editTagsButton")
|
||||
.attr("active-tag-ids")
|
||||
?.split(",") as string[];
|
||||
const activeTagIds = $(".pageTest .tags .editTagsButton").attr(
|
||||
"active-tag-ids"
|
||||
) as string;
|
||||
const tags = activeTagIds == "" ? [] : activeTagIds.split(",");
|
||||
$("#resultEditTagsPanel").attr("resultid", resultid);
|
||||
$("#resultEditTagsPanel").attr("tags", JSON.stringify(tags));
|
||||
$("#resultEditTagsPanel").attr("source", "resultPage");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue