feat: add a fixed-interval button for profiles updating #670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
关联 Issue: #525
描述:
此 Pull Request 旨在解决一个许多用户遇到的问题:在手动修改配置文件的更新间隔(
interval
)并保存后,当配置文件自动更新时,该间隔时间会被订阅响应头中的profile-update-interval
值覆盖,导致用户设置的值丢失,回到了默认或提供者指定的值。这对于希望强制使用自定义更新频率的用户来说很不方便。解决方案:
为了解决这个问题,本次提交引入了一个新的配置项
allowFixedInterval
(布尔值) 到IProfileItem
接口和相应的存储逻辑中。后端 (
src/main/config/profile.ts
):allowFixedInterval
为false
(或未设置,默认为false
) 时,才会使用从订阅头profile-update-interval
获取的值来更新配置文件的interval
。allowFixedInterval
设置为true
,则会保留用户之前设置的interval
值,忽略订阅头中的间隔建议。前端 (
src/renderer/src/components/profiles/edit-info-modal.tsx
):allowFixedInterval
标志。类型定义 (
src/shared/types.d.ts
):IProfileItem
接口,添加了可选的allowFixedInterval?: boolean
字段。本地化 (
src/renderer/src/locales/
):测试:
我已经对这些更改进行了本地测试:
目前看来功能运行正常,解决了最初描述的问题,并且没有引入新的问题。
请求:
这项改动解决了用户反馈较多的一个痛点,提高了用户自定义配置的灵活性。希望您能审阅此 PR,如果没什么问题,请考虑合并。感谢!