fix: default visibility-score to public

This commit is contained in:
Chloe Kudryavtsev 2022-08-19 17:52:33 -04:00 committed by Johann150
parent 549324a900
commit 2dcb681426
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -147,11 +147,10 @@ let imeText = $ref('');
// TODO: compat with misskey-js, should likely be moved into foundkey-js
const visibilityScore = (a: string): string => {
switch (a) {
case 'public': return 3;
case 'home': return 2;
case 'followers': return 1;
case 'specified': return 0;
default: return 4; // invalid visiblity = always considered "too high"
default: return 3; // includes public
}
};
const minVisibility = (a: string, b: string): string => visibilityScore(b) > visibilityScore(a) ? a : b;