Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Commit

Permalink
Removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Jul 3, 2023
1 parent f9b9e50 commit 6fb3105
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
5 changes: 2 additions & 3 deletions Wordle+/django/djapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ def create(self, request):
serializer.save(player=player)
return Response(serializer.data, status=201)



class AvatarView(APIView):
permission_classes = [permissions.IsAuthenticated]

Expand All @@ -215,7 +213,7 @@ def post(self, request, user_id):
# Delete the existing avatar if it exists
if user.avatar:
user.avatar.delete()

# Save the avatar image without encoding or decoding
filename = f'{user_id}_avatar.png'
user.avatar.save(filename, ContentFile(avatar_data.encode('utf-8')))
Expand All @@ -226,6 +224,7 @@ def post(self, request, user_id):
return Response({'detail': 'You do not have permission to upload an avatar.'}, status=403)
except CustomUser.DoesNotExist:
return Response({'detail': 'The specified user does not exist.'}, status=404)

class NotificationsViewSet(viewsets.ModelViewSet):
queryset = Notifications.objects.all()
serializer_class = NotificationsSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class EditUserPage implements OnInit {
});
});
const avatarUrl = await this.storageService.getAvatarUrl();
console.log(avatarUrl);
if (avatarUrl) {
this.avatarPreview = avatarUrl;
}
Expand Down Expand Up @@ -80,7 +79,6 @@ export class EditUserPage implements OnInit {
async uploadAvatar() {
const file = this.avatarInput.nativeElement.files[0];
if (file) {
console.log(file);
const reader = new FileReader();
reader.onloadend = () => {
const avatarData = reader.result as string;
Expand Down
4 changes: 1 addition & 3 deletions Wordle+/ionic/ionic-app/src/app/pages/login/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export class LoginPage implements OnInit {
// Rank is calculated in the frontend
}
this.isLoading = false;
setTimeout(async () => {
this.router.navigate(['/tabs/main'], { queryParams: { avatar: 'true' } });
}, 2000);
this.router.navigate(['/tabs/main'], { queryParams: { avatar: 'true' } });
},
(error) => {
console.error('Log in error', error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class NotificationService {
resolve(this.notifications);
} else {
const storedNotifications = await this.storageService.getNotifications();
console.log(storedNotifications);
if (storedNotifications) {
this.notifications = storedNotifications;
resolve(this.notifications);
Expand Down
3 changes: 0 additions & 3 deletions Wordle+/ionic/ionic-app/src/app/tab1/tab1.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,12 @@ export class Tab1Page implements OnInit{
});

await popover.present();

}

async loadAvatarImage() {
console.log('loading avatar');
(await this.apiService.getAvatarImage()).subscribe(
image => {
if (image) {
console.log('api');
this.avatarImage = image;
this.storageService.setAvatarUrl(this.avatarImage);
} else {
Expand Down

0 comments on commit 6fb3105

Please sign in to comment.