Skip to content

refactor: simplify preview handling and remove unnecessary memoization#488

Open
j2rong4cn wants to merge 5 commits intomainfrom
refactor-preview
Open

refactor: simplify preview handling and remove unnecessary memoization#488
j2rong4cn wants to merge 5 commits intomainfrom
refactor-preview

Conversation

@j2rong4cn
Copy link
Copy Markdown
Member

@j2rong4cn j2rong4cn commented Apr 28, 2026

Description / 描述

移除非必要的createMemo,因为预览文件会重载File组件

<Match when={objStore.state === State.File}>
<File />
</Match>
</Switch>

修复无法下载加密压缩包内的文件,由 #329 引入

Motivation and Context / 背景

Close #487
#446 (comment)

How Has This Been Tested? / 测试

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@j2rong4cn j2rong4cn marked this pull request as draft April 28, 2026 11:46
@j2rong4cn j2rong4cn marked this pull request as ready for review April 29, 2026 01:39
@j2rong4cn
Copy link
Copy Markdown
Member Author

j2rong4cn commented Apr 29, 2026

播放压缩包内的视频时,下一个视频会跳转到压缩包外,想着一起改了,改的地方有点多,下次吧
压缩包内只能顺序读取,不推荐在线预览(不支持响应206状态码)

return getPreviews({ ...objStore.obj, provider: objStore.provider })
})
const selectedPreviewKey = createMemo(() => searchParams["preview"] || "")
const previews = getPreviews({ ...objStore.obj, provider: objStore.provider })
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果使用createMemo在预览压缩包时更新objStore.obj这里也会更新,导致回到压缩包根目录

@j2rong4cn j2rong4cn force-pushed the refactor-preview branch from 93e08f4 to cf503e9 Compare May 1, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

压缩包功能缺陷:压缩包内视频无法拖拽进度条(v4.1.10);升级 v4.2.1 后压缩包内文件/文件夹完全无法打开

1 participant