|
|
@ -1,6 +1,7 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
Map as ImmutableMap,
|
|
|
|
Map as ImmutableMap,
|
|
|
|
List as ImmutableList,
|
|
|
|
List as ImmutableList,
|
|
|
|
|
|
|
|
OrderedSet as ImmutableOrderedSet,
|
|
|
|
fromJS,
|
|
|
|
fromJS,
|
|
|
|
} from 'immutable';
|
|
|
|
} from 'immutable';
|
|
|
|
import { AnyAction } from 'redux';
|
|
|
|
import { AnyAction } from 'redux';
|
|
|
@ -82,8 +83,8 @@ const addTags = (
|
|
|
|
): State => {
|
|
|
|
): State => {
|
|
|
|
return state.withMutations(state => {
|
|
|
|
return state.withMutations(state => {
|
|
|
|
accountIds.forEach(id => {
|
|
|
|
accountIds.forEach(id => {
|
|
|
|
state.updateIn([id, 'pleroma', 'tags'], ImmutableList(), (v: ImmutableList<string>) =>
|
|
|
|
state.updateIn([id, 'pleroma', 'tags'], ImmutableList(), v =>
|
|
|
|
v.toOrderedSet().union(tags).toList(),
|
|
|
|
ImmutableOrderedSet(fromJS(v)).union(tags).toList(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -96,8 +97,8 @@ const removeTags = (
|
|
|
|
): State => {
|
|
|
|
): State => {
|
|
|
|
return state.withMutations(state => {
|
|
|
|
return state.withMutations(state => {
|
|
|
|
accountIds.forEach(id => {
|
|
|
|
accountIds.forEach(id => {
|
|
|
|
state.updateIn([id, 'pleroma', 'tags'], ImmutableList(), (v: ImmutableList<string>) =>
|
|
|
|
state.updateIn([id, 'pleroma', 'tags'], ImmutableList(), v =>
|
|
|
|
v.toOrderedSet().subtract(tags).toList(),
|
|
|
|
ImmutableOrderedSet(fromJS(v)).subtract(tags).toList(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|