merge next into next-reply
This commit is contained in:
@@ -39,7 +39,7 @@ export function bytesToHumanSize(bytes) {
|
||||
|
||||
// Get 32 bit integer hash value for a string. Ideally it should produce the same value
|
||||
// as Java's String#hash().
|
||||
function stringToColorHash(value) {
|
||||
export function stringToColorHash(value) {
|
||||
let hash = 0;
|
||||
value = '' + value;
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
|
||||
+2
-2
@@ -2,11 +2,11 @@
|
||||
|
||||
import Tinode from 'tinode-sdk';
|
||||
|
||||
import { stringHash } from './strformat.js';
|
||||
import { stringToColorHash } from './strformat.js';
|
||||
|
||||
// User avatar letter color id.
|
||||
export function letterTileColor(userId) {
|
||||
return Math.abs(stringHash(userId)) % 16;
|
||||
return Math.abs(stringToColorHash(userId)) % 16;
|
||||
}
|
||||
|
||||
// Make shortcut icon appear with a green dot + show unread count in title.
|
||||
|
||||
Reference in New Issue
Block a user