Browse Source

Use different avatar color based on uploader name

Neeraj Gupta 2 years ago
parent
commit
0e4e9bfc4c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/ui/viewer/file/thumbnail_widget.dart

+ 3 - 1
lib/ui/viewer/file/thumbnail_widget.dart

@@ -128,9 +128,11 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
           );
           );
         } else if (widget.file.pubMagicMetadata.uploaderName != null) {
         } else if (widget.file.pubMagicMetadata.uploaderName != null) {
           contentChildren.add(
           contentChildren.add(
+            // Use uploadName hashCode as userID so that different uploader
+            // get avatar color
             OwnerAvatarOverlayIcon(
             OwnerAvatarOverlayIcon(
               User(
               User(
-                id: widget.file.ownerID,
+                id: widget.file.pubMagicMetadata.uploaderName.hashCode,
                 email: owner.email,
                 email: owner.email,
                 name: widget.file.pubMagicMetadata.uploaderName,
                 name: widget.file.pubMagicMetadata.uploaderName,
               ),
               ),