Fix display name input field and enable ensureParent for avatar uploads
- Remove controller text reset in BlocBuilder to allow typing - Always call ensureParent in WebDAV upload to create .avatars folder if needed
This commit is contained in:
@@ -388,11 +388,6 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
||||
// Always ensure we have the current user
|
||||
if (authState is AuthAuthenticated) {
|
||||
_currentUser = authState.user;
|
||||
// Only update controller if it's empty (first time) or if user changed
|
||||
if (_displayNameController.text.isEmpty ||
|
||||
_currentUser?.displayName != _displayNameController.text) {
|
||||
_displayNameController.text = _currentUser?.displayName ?? '';
|
||||
}
|
||||
_avatarUrl = _currentUser?.avatarUrl;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +91,9 @@ func (c *WebDAVClient) Upload(ctx context.Context, remotePath string, r io.Reade
|
||||
if c == nil {
|
||||
return fmt.Errorf("no webdav client configured")
|
||||
}
|
||||
// Ensure parent collections (skip for hidden avatar folders to avoid MKCOL timeouts)
|
||||
if !strings.HasPrefix(remotePath, ".avatars") {
|
||||
if err := c.ensureParent(ctx, remotePath); err != nil {
|
||||
return err
|
||||
}
|
||||
// Ensure parent collections
|
||||
if err := c.ensureParent(ctx, remotePath); err != nil {
|
||||
return err
|
||||
}
|
||||
// Construct URL
|
||||
// remotePath might be like /orgs/<id>/file.txt; ensure it joins to basePrefix
|
||||
|
||||
Reference in New Issue
Block a user