Skip to content

Commit 88a0559

Browse files
committed
frontend: fix no-param-reassign error
Fixed lint no-param-reassign error that was enabled in last commit.
1 parent 67b8771 commit 88a0559

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

frontends/web/src/utils/walletconnect.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,21 @@ export const rejectMessage = (id: number) => {
108108
};
109109

110110
export const decodeEthMessage = (hex: string) => {
111-
hex = hex.trim();
112-
if (hex.startsWith('0x')) {
113-
hex = hex.substring(2);
111+
let message = hex.trim();
112+
if (message.startsWith('0x')) {
113+
message = message.substring(2);
114114
}
115115

116116
// Validate input.
117-
if (hex.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(hex)) {
117+
if (message.length % 2 !== 0 || !/^[0-9a-fA-F]*$/.test(message)) {
118118
console.error('Invalid hex string');
119119
return null;
120120
}
121121

122122
// Create a Uint8Array from the hex string.
123-
const bytes = new Uint8Array(hex.length / 2);
123+
const bytes = new Uint8Array(message.length / 2);
124124
for (let i = 0; i < bytes.length; i++) {
125-
const byte = parseInt(hex.substring(i * 2, i * 2 + 2), 16);
125+
const byte = parseInt(message.substring(i * 2, i * 2 + 2), 16);
126126
if (isNaN(byte)) {
127127
console.error('Invalid byte in hex string');
128128
return null;

0 commit comments

Comments
 (0)