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:
Leon Bösche
2026-01-29 20:28:55 +01:00
parent 04f08c1b1c
commit 8bf6bde38d
2 changed files with 3 additions and 10 deletions

View File

@@ -388,11 +388,6 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
// Always ensure we have the current user // Always ensure we have the current user
if (authState is AuthAuthenticated) { if (authState is AuthAuthenticated) {
_currentUser = authState.user; _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; _avatarUrl = _currentUser?.avatarUrl;
} }

View File

@@ -91,12 +91,10 @@ func (c *WebDAVClient) Upload(ctx context.Context, remotePath string, r io.Reade
if c == nil { if c == nil {
return fmt.Errorf("no webdav client configured") return fmt.Errorf("no webdav client configured")
} }
// Ensure parent collections (skip for hidden avatar folders to avoid MKCOL timeouts) // Ensure parent collections
if !strings.HasPrefix(remotePath, ".avatars") {
if err := c.ensureParent(ctx, remotePath); err != nil { if err := c.ensureParent(ctx, remotePath); err != nil {
return err return err
} }
}
// Construct URL // Construct URL
// remotePath might be like /orgs/<id>/file.txt; ensure it joins to basePrefix // remotePath might be like /orgs/<id>/file.txt; ensure it joins to basePrefix
rel := strings.TrimLeft(remotePath, "/") rel := strings.TrimLeft(remotePath, "/")