Description
Currently, the getNodeIconType utility function in the WebDAV File Picker returns an object containing { icon, type, extension }. However, looking at the codebase and the inline // TODO, this function's callers only ever use the icon property.
Returning the unused type and extension variables adds unnecessary complexity. This issue proposes simplifying the function to directly return the icon name and updating its consumers and unit tests accordingly.
Expected Behavior
getNodeIconType.ts returns an IconName string instead of an object.
- Unused
type and extension local variables are removed from the function.
- WebDAV table and grid components consume the simplified return type.
Actual Behavior
- The function calculates and returns unused data, and caller components have to destruct the object:
const { icon } = getNodeIconType(...)
Context
This was noted as a // TODO in apps/meteor/client/views/room/webdav/WebdavFilePickerModal/lib/getNodeIconType.ts. Cleaning this up will improve code maintainability.
Description
Currently, the
getNodeIconTypeutility function in the WebDAV File Picker returns an object containing{ icon, type, extension }. However, looking at the codebase and the inline// TODO, this function's callers only ever use theiconproperty.Returning the unused
typeandextensionvariables adds unnecessary complexity. This issue proposes simplifying the function to directly return theiconname and updating its consumers and unit tests accordingly.Expected Behavior
getNodeIconType.tsreturns anIconNamestring instead of an object.typeandextensionlocal variables are removed from the function.Actual Behavior
const { icon } = getNodeIconType(...)Context
This was noted as a
// TODOinapps/meteor/client/views/room/webdav/WebdavFilePickerModal/lib/getNodeIconType.ts. Cleaning this up will improve code maintainability.