Update immutable imports for v5 (#33037)
This commit is contained in:
		
					parent
					
						
							
								21a8612aab
							
						
					
				
			
			
				commit
				
					
						27e79da6b9
					
				
			
		
					 5 changed files with 28 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -1,11 +1,11 @@
 | 
			
		|||
import Immutable from 'immutable';
 | 
			
		||||
import { Map as ImmutableMap } from 'immutable';
 | 
			
		||||
 | 
			
		||||
import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from '../actions/push_notifications';
 | 
			
		||||
import { STORE_HYDRATE } from '../actions/store';
 | 
			
		||||
 | 
			
		||||
const initialState = Immutable.Map({
 | 
			
		||||
const initialState = ImmutableMap({
 | 
			
		||||
  subscription: null,
 | 
			
		||||
  alerts: new Immutable.Map({
 | 
			
		||||
  alerts: ImmutableMap({
 | 
			
		||||
    follow: false,
 | 
			
		||||
    follow_request: false,
 | 
			
		||||
    favourite: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +24,7 @@ export default function push_subscriptions(state = initialState, action) {
 | 
			
		|||
 | 
			
		||||
    if (push_subscription) {
 | 
			
		||||
      return state
 | 
			
		||||
        .set('subscription', new Immutable.Map({
 | 
			
		||||
        .set('subscription', ImmutableMap({
 | 
			
		||||
          id: push_subscription.get('id'),
 | 
			
		||||
          endpoint: push_subscription.get('endpoint'),
 | 
			
		||||
        }))
 | 
			
		||||
| 
						 | 
				
			
			@ -36,11 +36,11 @@ export default function push_subscriptions(state = initialState, action) {
 | 
			
		|||
  }
 | 
			
		||||
  case SET_SUBSCRIPTION:
 | 
			
		||||
    return state
 | 
			
		||||
      .set('subscription', new Immutable.Map({
 | 
			
		||||
      .set('subscription', ImmutableMap({
 | 
			
		||||
        id: action.subscription.id,
 | 
			
		||||
        endpoint: action.subscription.endpoint,
 | 
			
		||||
      }))
 | 
			
		||||
      .set('alerts', new Immutable.Map(action.subscription.alerts))
 | 
			
		||||
      .set('alerts', ImmutableMap(action.subscription.alerts))
 | 
			
		||||
      .set('isSubscribed', true);
 | 
			
		||||
  case SET_BROWSER_SUPPORT:
 | 
			
		||||
    return state.set('browserSupport', action.value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue