[Glitch] Refactor privacyPrefence() to use priority list

Port 2b44b7a9f6 to glitch-soc
th-downstream
Thibaut Girka 6 years ago committed by ThibG
parent 1a3e119ef7
commit 78811a547c

@ -207,15 +207,8 @@ const insertEmoji = (state, position, emojiData) => {
};
const privacyPreference = (a, b) => {
if (a === 'direct' || b === 'direct') {
return 'direct';
} else if (a === 'private' || b === 'private') {
return 'private';
} else if (a === 'unlisted' || b === 'unlisted') {
return 'unlisted';
} else {
return 'public';
}
const order = ['public', 'unlisted', 'private', 'direct'];
return order[Math.max(order.indexOf(a), order.indexOf(b), 0)];
};
const hydrate = (state, hydratedState) => {

Loading…
Cancel
Save