Convert disconnectTimeline
and timelineDelete
actions to Typescript (#30777)
This commit is contained in:
parent
27529247b2
commit
1c65932776
11 changed files with 65 additions and 49 deletions
|
@ -4,8 +4,7 @@ import {
|
|||
deployPictureInPictureAction,
|
||||
removePictureInPicture,
|
||||
} from 'mastodon/actions/picture_in_picture';
|
||||
|
||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||
import { timelineDelete } from 'mastodon/actions/timelines_typed';
|
||||
|
||||
export interface PIPMediaProps {
|
||||
src: string;
|
||||
|
@ -49,8 +48,9 @@ export const pictureInPictureReducer: Reducer<PIPState> = (
|
|||
...action.payload.props,
|
||||
};
|
||||
else if (removePictureInPicture.match(action)) return initialState;
|
||||
else if (action.type === TIMELINE_DELETE)
|
||||
if (state.type && state.statusId === action.id) return initialState;
|
||||
else if (timelineDelete.match(action))
|
||||
if (state.type && state.statusId === action.payload.statusId)
|
||||
return initialState;
|
||||
|
||||
return state;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue