Various fixes: profilePicture / logo upload, imageIdentifiers (#6530)
In this PR: - refactoring auth module to extract a jwt module that can be re-used from other part of the app (avoiding circular dependencies file module => auth => file (file and auth both need jwt actually) - activating imageIdentfier on person on workspace creation (this will put back the images on people) - fixing picture upload (we were missing some fileToken)
This commit is contained in:
@ -51,7 +51,7 @@ export const ProfilePictureUploader = () => {
|
||||
setUploadController(null);
|
||||
setErrorMessage(null);
|
||||
|
||||
const avatarUrl = result?.data?.uploadProfilePicture;
|
||||
const avatarUrl = result?.data?.uploadProfilePicture.split('?')[0];
|
||||
|
||||
if (!avatarUrl) {
|
||||
throw new Error('Avatar URL not found');
|
||||
@ -64,7 +64,10 @@ export const ProfilePictureUploader = () => {
|
||||
},
|
||||
});
|
||||
|
||||
setCurrentWorkspaceMember({ ...currentWorkspaceMember, avatarUrl });
|
||||
setCurrentWorkspaceMember({
|
||||
...currentWorkspaceMember,
|
||||
avatarUrl: result?.data?.uploadProfilePicture,
|
||||
});
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
|
||||
@ -7,6 +7,7 @@ import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/consta
|
||||
import { DEFAULT_WORKSPACE_NAME } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { NavigationDrawerCollapseButton } from './NavigationDrawerCollapseButton';
|
||||
|
||||
const StyledContainer = styled.div<{ isMultiWorkspace: boolean }>`
|
||||
@ -65,7 +66,9 @@ export const NavigationDrawerHeader = ({
|
||||
<MultiWorkspaceDropdownButton workspaces={workspaces} />
|
||||
) : (
|
||||
<>
|
||||
<StyledLogo logo={logo} />
|
||||
<StyledLogo
|
||||
logo={isNonEmptyString(logo) ? logo : DEFAULT_WORKSPACE_LOGO}
|
||||
/>
|
||||
<StyledName>{name}</StyledName>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user