[user][bug][cards] fix nonascii username handling

This commit is contained in:
Andrea Vos 2022-10-26 10:18:20 +02:00
parent 0f16d5970e
commit ac30fd7c79

View File

@ -64,7 +64,7 @@ const shoot = async (db, mode) => {
for (let {id, locale, username} of profiles) {
const cardId = ulid();
let key = `card/${locale}/${username}-${cardId}.png`;
let key = `card/${locale}/${encodeURIComponent(username).replace(/'/g, '_')}-${cardId}.png`;
if (mode === 'dark') {
key = mode === 'dark' ? key.replace('.png', '-dark.png') : key;
}