kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
refactor: toggleMuteStatus accepts pure Status rather than Legacy Immutable Status
rodzic
cfce081063
commit
3aa6582b09
|
@ -1,3 +1,4 @@
|
||||||
|
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||||
import { shouldHaveCard } from 'soapbox/utils/status.ts';
|
import { shouldHaveCard } from 'soapbox/utils/status.ts';
|
||||||
|
@ -277,7 +278,7 @@ const unmuteStatus = (id: string) =>
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleMuteStatus = (status: Status) =>
|
const toggleMuteStatus = (status: StatusEntity) =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
if (status.muted) {
|
if (status.muted) {
|
||||||
dispatch(unmuteStatus(status.id));
|
dispatch(unmuteStatus(status.id));
|
||||||
|
|
|
@ -363,7 +363,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleConversationMuteClick: React.EventHandler<React.MouseEvent> = (e) => {
|
const handleConversationMuteClick: React.EventHandler<React.MouseEvent> = (e) => {
|
||||||
dispatch(toggleMuteStatus(status));
|
dispatch(toggleMuteStatus(status.toJS() as StatusEntity));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopy: React.EventHandler<React.MouseEvent> = (e) => {
|
const handleCopy: React.EventHandler<React.MouseEvent> = (e) => {
|
||||||
|
|
Ładowanie…
Reference in New Issue