Skip to content

Commit 96f5891

Browse files
authored
Fix for the GUI settings not applying immediately (#8340)
2 parents e5dd276 + 931664c commit 96f5891

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/tribler/core/tunnel/community.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ def is_bencoded(x: bytes) -> bool:
5151
"""
5252
Returns True is x appears to be valid bencoded byte string.
5353
"""
54-
return bdecode(x) is not None
54+
if not isinstance(x, bytes):
55+
msg = f'Expected bytes, got {type(x).__name__}'
56+
raise TypeError(msg)
57+
try:
58+
decoded = bdecode(x)
59+
except RuntimeError:
60+
decoded = None
61+
return decoded is not None
5562

5663

5764
class TriblerTunnelSettings(HiddenTunnelSettings):

src/tribler/ui/src/services/tribler.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export class TriblerService {
294294

295295
async setSettings(settings: Partial<Settings>): Promise<undefined | ErrorDict | boolean> {
296296
try {
297-
this.guiSettings = {...settings?.ui, ...this.guiSettings};
297+
this.guiSettings = {...this.guiSettings, ...settings?.ui};
298298
return (await this.http.post('/settings', settings)).data.modified;
299299
} catch (error) {
300300
return formatAxiosError(error as Error | AxiosError);

0 commit comments

Comments
 (0)