Update avatar URL in auth state after successful upload
This commit is contained in:
@@ -104,6 +104,14 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
||||
_avatarUploadProgress = 0.0;
|
||||
});
|
||||
|
||||
// Update auth state with new avatar
|
||||
if (_currentUser != null && _avatarUrl != null) {
|
||||
final updatedUser = _currentUser!.copyWith(avatarUrl: _avatarUrl);
|
||||
if (mounted) {
|
||||
context.read<AuthBloc>().add(UpdateUserProfile(updatedUser));
|
||||
}
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Avatar uploaded successfully')),
|
||||
|
||||
@@ -31,44 +31,48 @@ run_migration() {
|
||||
}
|
||||
|
||||
# Run migrations in order
|
||||
echo "Step 1/10: Initial schema..."
|
||||
echo "Step 1/11: Initial schema..."
|
||||
run_migration "$SCRIPT_DIR/0001_initial.sql"
|
||||
|
||||
echo
|
||||
echo "Step 2/10: Passkeys and authentication..."
|
||||
echo "Step 2/11: Passkeys and authentication..."
|
||||
run_migration "$SCRIPT_DIR/0002_passkeys.sql"
|
||||
|
||||
echo
|
||||
echo "Step 3/10: Files and storage..."
|
||||
echo "Step 3/11: Files and storage..."
|
||||
run_migration "$SCRIPT_DIR/0003_files.sql"
|
||||
|
||||
echo
|
||||
echo "Step 4/10: Organization ownership and slug scope..."
|
||||
echo "Step 4/11: Organization ownership and slug scope..."
|
||||
run_migration "$SCRIPT_DIR/0004_org_owner_slug.sql"
|
||||
|
||||
echo
|
||||
echo "Step 5/10: Organization invitations and join requests..."
|
||||
echo "Step 5/11: Organization invitations and join requests..."
|
||||
run_migration "$SCRIPT_DIR/0005_org_invitations.sql"
|
||||
|
||||
echo
|
||||
echo "Step 6/10: Organization invite links..."
|
||||
echo "Step 6/11: Organization invite links..."
|
||||
run_migration "$SCRIPT_DIR/0006_org_invite_link.sql"
|
||||
|
||||
echo
|
||||
echo "Step 7/10: File share links..."
|
||||
echo "Step 7/11: File share links..."
|
||||
run_migration "$SCRIPT_DIR/0007_file_share_links.sql"
|
||||
|
||||
echo
|
||||
echo "Step 8/10: File share links nullable org..."
|
||||
echo "Step 8/11: File share links nullable org..."
|
||||
run_migration "$SCRIPT_DIR/0008_file_share_links_nullable_org.sql"
|
||||
|
||||
echo
|
||||
echo "Step 9/10: File share links org id nullable..."
|
||||
echo "Step 9/11: File share links org id nullable..."
|
||||
run_migration "$SCRIPT_DIR/0009_file_share_links_org_id_nullable.sql"
|
||||
|
||||
echo
|
||||
echo "Step 10/10: Add avatar URL to users..."
|
||||
echo "Step 10/11: Add avatar URL to users..."
|
||||
run_migration "$SCRIPT_DIR/0010_add_avatar_url.sql"
|
||||
|
||||
echo
|
||||
echo "Step 11/11: Add updated_at to users..."
|
||||
run_migration "$SCRIPT_DIR/0011_add_updated_at.sql"
|
||||
|
||||
echo
|
||||
echo "=== All migrations completed successfully! ==="
|
||||
|
||||
Reference in New Issue
Block a user