mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-26 05:33:43 +01:00
[Glitch] Refactor privacyPrefence() to use priority list
Port f2d9a3c239
to glitch-soc
This commit is contained in:
parent
d67cb13d84
commit
cd05378b59
1 changed files with 2 additions and 9 deletions
|
@ -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…
Reference in a new issue