Skip to content

Add can use folders hook - #134

Open
veliseev93 wants to merge 2 commits into
developmentfrom
veliseev/fix-folders-request
Open

veliseev93 wants to merge 2 commits into
developmentfrom
veliseev/fix-folders-request

Conversation

@veliseev93

Copy link
Copy Markdown
Collaborator

Fixed error when folders are disabled in admin panel

@VitalyMih VitalyMih left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@veliseev93 couple questions :)

Comment thread apps/mobile/app/(main)/chat/list.tsx Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not used

isLoading: boolean;
}

export function useCanUseFolders(): UseCanUseFoldersResult {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

useCanUseFolders reads a bit awkward ("use can use"). Since this returns whether the folders feature is available, something like useFoldersEnabled would read more naturally. What do you think?

(profile?.role === UserRole.ADMIN || (profile?.permissions.features.folders ?? true)),
);

return { canUseFolders, isLoading: isConfigLoading || isProfileLoading };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isLoading isn't used anywhere in the app currently. Is it intended for future use, or should we drop it from the hook's return value for now?

@VitalyMih VitalyMih assigned veliseev93 and unassigned VitalyMih Sep 14, 2026
@veliseev93

Copy link
Copy Markdown
Collaborator Author

@VitalyMih Thank you, fixed

@veliseev93 veliseev93 assigned VitalyMih and unassigned veliseev93 Sep 15, 2026
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.

2 participants