HelloZeroNet / HelloZeroNet/ZeroNet

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

未关闭
#2,162 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
18.8k
派生
2.3k
PR 合并指标
30 天内没有已合并 PR

描述

### 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

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
coffeescript
领域
frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。