HelloZeroNet / HelloZeroNet/ZeroNet

Toggling "Open web browser on ZeroNet startup" twice doesn't restore old browser

Đang mở
#2,162 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
18.8k
Fork
2.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Step 1: Please describe your environment

* ZeroNet version: v0.7.0, rev4172
* Operating system: reproducible on all
* Web browser: doesn't matter
* Tor status: doesn't matter
* Opened port: doesn't matter
* Special configuration: none

### Step 2: Describe the problem:

Quote from UiConfig.coffee:

```coffee
if key == "open_browser"
if value
value = "default_browser"
else
value = "False"
```

This means that once you click the checkbox (even accidentally) and you've manually set a browser (which might have a long path with CLI options), there's no easy way to restore it.

This also leads to a fact that toggling the checkbox twice doesn't remove the "1 configuration item value changed" banner, while toggling any other checkbox twice *does* remove it. This leads to confusion.

#### Steps to reproduce:

1. Setup a non-standard browser path in zeronet.conf (even `open_browser = chrome` will work)
2. Open UI Config
3. Toggle "Open web browser on ZeroNet startup" checkbox
4. Toggle "Open web browser on ZeroNet startup" checkbox
5. Press "Save settings"
6. Reboot ZeroNet

#### Observed Results:

`chrome` is replaced with `default_browser`

#### Expected Results:

`chrome` is not changed

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start in UiConfig.coffee, especially the open_browser handling shown in the issue, and reproduce the six listed steps with a custom value such as chrome. The fix is complete when toggling the checkbox twice preserves that value, removes the changed-settings banner, and leaves it unchanged after saving and rebooting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
coffeescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.