Skip to content

Commit 1889c6a

Browse files
committed
1 parent 14373b6 commit 1889c6a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

extension.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ let lastCount = 0, lastSpeed = 0, lastCountUp = 0;
2020
let mode; // 0: kbps 1: K/s 2: U:kbps D:kbps 3: U:K/s D:K/s 4: Total KB
2121
let fontmode;
2222
let resetNextCount = false, resetCount = 0;
23-
let byteArrayToString;
2423

25-
if (global.TextDecoder) {
26-
// available in gjs >= 1.70 (GNOME Shell >= 42)
27-
byteArrayToString = (new TextDecoder().decode);
28-
}
29-
else {
30-
// gjs-specific
31-
byteArrayToString = imports.byteArray.toString;
24+
function byteArrayToString(bytes) {
25+
if (global.TextDecoder) {
26+
return new TextDecoder().decode(bytes);
27+
}
28+
29+
return imports.byteArray.toString(bytes);
3230
}
3331

3432
function init() {

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
],
1414
"url": "https://github.com/biji/simplenetspeed",
1515
"uuid": "[email protected]",
16-
"version": 26
16+
"version": 28
1717
}

0 commit comments

Comments
 (0)