-
Notifications
You must be signed in to change notification settings - Fork 263
feat: platform self-adaptation for file viewer application #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
{((expanded ? Object.values(ViewersByID) : selectorState?.viewers) ?? emptyViewer) | ||
.filter((viewer) => { | ||
const platform = viewer.platform || "all"; | ||
return platform === "all" || platform === (isMobile ? "mobile" : "pc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those filtered viewers are not excluded in https://github.com/cloudreve/frontend/blob/master/src/component/FileManager/ContextMenu/OpenWithMenuItems.tsx
Maybe you can do the filtering here:
frontend/src/redux/siteConfigSlice.ts
Line 71 in 2c56116
config.file_viewers?.forEach((group) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isMobile
based to useMediaQuery
, it seems not suitable to be put into redux:
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
I haven't thought of a better way yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get the client windows width easily in native JS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/component/Admin/Settings/Filesystem/ViewerSetting/FileViewerEditDialog.tsx
Show resolved
Hide resolved
Good job, thanks! |
Ref: cloudreve/cloudreve#2306