fix(desktop): 为更新错误横幅添加关闭按钮#3708
Open
whale-fall-ouo wants to merge 1 commit into
Open
Conversation
在 UpdateBanner 的 error case 中添加 dismiss 按钮,使用已有的 reset() 函数 将状态重置为 idle。网络异常时用户可以关闭错误横幅,不再被强制显示。 Fixes esengine#3699
5218575 to
b0801d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题描述
当桌面应用启动时如果没有网络连接,自动更新检查会失败并显示错误横幅。该横幅无法关闭——只有"重试"按钮,没有关闭/取消选项。横幅会持续显示在所有标签页和会话中,直到网络连接恢复。
复现步骤
修复方案
在
UpdateBanner组件的errorcase 中添加 dismiss 按钮,使用已有的reset()函数将状态重置为 idle。与availablecase 中的关闭按钮行为一致。改动
desktop/frontend/src/components/UpdateBanner.tsx:解构时加入reset,在 Retry 按钮后添加 dismiss 按钮Fixes #3699
