Skip to content

Commit a64cfb3

Browse files
authored
Update StakingScreen.vue (#2258)
1 parent cc65ddf commit a64cfb3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

launcher/src/components/UI/staking-page/StakingScreen.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,15 @@ const exportExitMessage = async () => {
612612
};
613613
614614
const saveExitMessage = (data, type) => {
615+
// Helper to strip a potential `data` wrapper returned by the API
616+
const unwrap = (entry) => (entry && entry.data ? entry.data : entry);
617+
615618
const content =
616-
type === "single" ? JSON.stringify(data.data, null, 2) : data.map((entry) => JSON.stringify(entry.data, null, 2)).join("\n\n");
619+
type === "single"
620+
? JSON.stringify(unwrap(data), null, 2)
621+
: data
622+
.map((entry) => JSON.stringify(unwrap(entry), null, 2))
623+
.join("\n\n");
617624
618625
const fileName = type === "single" ? "single_exit_message.txt" : "multiple_exit_messages.txt";
619626
const blob = new Blob([content], { type: "application/json;charset=utf-8" });

0 commit comments

Comments
 (0)