2016-10-31 01:06:43 +11:00
|
|
|
import api from '../api';
|
|
|
|
|
2022-02-10 10:15:30 +11:00
|
|
|
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
|
2023-05-24 01:15:17 +10:00
|
|
|
import { importFetchedStatus, importFetchedStatuses, importFetchedAccount } from './importer';
|
|
|
|
import { deleteFromTimelines } from './timelines';
|
2016-09-13 10:24:40 +10:00
|
|
|
|
|
|
|
export const STATUS_FETCH_REQUEST = 'STATUS_FETCH_REQUEST';
|
|
|
|
export const STATUS_FETCH_SUCCESS = 'STATUS_FETCH_SUCCESS';
|
|
|
|
export const STATUS_FETCH_FAIL = 'STATUS_FETCH_FAIL';
|
2016-09-16 08:21:51 +10:00
|
|
|
|
2016-09-30 08:00:45 +10:00
|
|
|
export const STATUS_DELETE_REQUEST = 'STATUS_DELETE_REQUEST';
|
|
|
|
export const STATUS_DELETE_SUCCESS = 'STATUS_DELETE_SUCCESS';
|
|
|
|
export const STATUS_DELETE_FAIL = 'STATUS_DELETE_FAIL';
|
|
|
|
|
2016-10-31 01:06:43 +11:00
|
|
|
export const CONTEXT_FETCH_REQUEST = 'CONTEXT_FETCH_REQUEST';
|
|
|
|
export const CONTEXT_FETCH_SUCCESS = 'CONTEXT_FETCH_SUCCESS';
|
|
|
|
export const CONTEXT_FETCH_FAIL = 'CONTEXT_FETCH_FAIL';
|
|
|
|
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
export const STATUS_MUTE_REQUEST = 'STATUS_MUTE_REQUEST';
|
|
|
|
export const STATUS_MUTE_SUCCESS = 'STATUS_MUTE_SUCCESS';
|
|
|
|
export const STATUS_MUTE_FAIL = 'STATUS_MUTE_FAIL';
|
|
|
|
|
|
|
|
export const STATUS_UNMUTE_REQUEST = 'STATUS_UNMUTE_REQUEST';
|
|
|
|
export const STATUS_UNMUTE_SUCCESS = 'STATUS_UNMUTE_SUCCESS';
|
|
|
|
export const STATUS_UNMUTE_FAIL = 'STATUS_UNMUTE_FAIL';
|
|
|
|
|
Summary: fix slowness due to layout thrashing when reloading a large … (#12661)
* Summary: fix slowness due to layout thrashing when reloading a large set of status updates
in order to limit the maximum size of a status in a list view (e.g. the home timeline), so as to avoid having to scroll all the way through an abnormally large status update (see https://github.com/tootsuite/mastodon/pull/8205), the following steps are taken:
•the element containing the status is rendered in the browser
•its height is calculated, to determine if it exceeds the maximum height threshold.
Unfortunately for performance, these steps are carried out in the componentDidMount(/Update) method, which also performs style modifications on the element. The combination of height request and style modification during javascript evaluation in the browser leads to layout-thrashing, where the elements are repeatedly re-laid-out (see https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing & https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers).
The solution implemented here is to memoize the collapsed state in Redux the first time the status is seen (e.g. when fetched as part of a small batch, to populate the home timeline) , so that on subsequent re-renders, the value can be queried, rather than recalculated. This strategy is derived from https://github.com/tootsuite/mastodon/pull/4439 & https://github.com/tootsuite/mastodon/pull/4909, and should resolve https://github.com/tootsuite/mastodon/issues/12455.
Andrew Lin (https://github.com/onethreeseven) is thanked for his assistance in root cause analysis and solution brainstorming
* remove getSnapshotBeforeUpdate from status
* remove componentWillUnmount from status
* persist last-intersected status update and restore when ScrollableList is restored
e.g. when navigating from home-timeline to a status conversational thread and <Back again
* cache currently-viewing status id to avoid calling redux with identical value
* refactor collapse toggle to pass explicit boolean
2019-12-29 15:39:48 +11:00
|
|
|
export const STATUS_REVEAL = 'STATUS_REVEAL';
|
|
|
|
export const STATUS_HIDE = 'STATUS_HIDE';
|
|
|
|
export const STATUS_COLLAPSE = 'STATUS_COLLAPSE';
|
2018-03-11 19:52:59 +11:00
|
|
|
|
2018-06-05 08:17:38 +10:00
|
|
|
export const REDRAFT = 'REDRAFT';
|
|
|
|
|
2022-02-10 10:15:30 +11:00
|
|
|
export const STATUS_FETCH_SOURCE_REQUEST = 'STATUS_FETCH_SOURCE_REQUEST';
|
|
|
|
export const STATUS_FETCH_SOURCE_SUCCESS = 'STATUS_FETCH_SOURCE_SUCCESS';
|
|
|
|
export const STATUS_FETCH_SOURCE_FAIL = 'STATUS_FETCH_SOURCE_FAIL';
|
|
|
|
|
2022-09-24 07:00:12 +10:00
|
|
|
export const STATUS_TRANSLATE_REQUEST = 'STATUS_TRANSLATE_REQUEST';
|
|
|
|
export const STATUS_TRANSLATE_SUCCESS = 'STATUS_TRANSLATE_SUCCESS';
|
|
|
|
export const STATUS_TRANSLATE_FAIL = 'STATUS_TRANSLATE_FAIL';
|
|
|
|
export const STATUS_TRANSLATE_UNDO = 'STATUS_TRANSLATE_UNDO';
|
|
|
|
|
2017-01-19 21:06:06 +11:00
|
|
|
export function fetchStatusRequest(id, skipLoading) {
|
2016-09-16 08:21:51 +10:00
|
|
|
return {
|
|
|
|
type: STATUS_FETCH_REQUEST,
|
2017-01-19 21:06:06 +11:00
|
|
|
id,
|
2017-05-21 01:31:47 +10:00
|
|
|
skipLoading,
|
2016-09-16 08:21:51 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-16 08:21:51 +10:00
|
|
|
|
2022-08-25 12:27:47 +10:00
|
|
|
export function fetchStatus(id, forceFetch = false) {
|
2016-09-16 08:21:51 +10:00
|
|
|
return (dispatch, getState) => {
|
2022-08-25 12:27:47 +10:00
|
|
|
const skipLoading = !forceFetch && getState().getIn(['statuses', id], null) !== null;
|
2017-01-19 21:06:06 +11:00
|
|
|
|
2017-02-17 11:34:37 +11:00
|
|
|
dispatch(fetchContext(id));
|
|
|
|
|
|
|
|
if (skipLoading) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-19 21:06:06 +11:00
|
|
|
dispatch(fetchStatusRequest(id, skipLoading));
|
2016-09-16 08:21:51 +10:00
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().get(`/api/v1/statuses/${id}`).then(response => {
|
2018-03-24 23:06:27 +11:00
|
|
|
dispatch(importFetchedStatus(response.data));
|
|
|
|
dispatch(fetchStatusSuccess(skipLoading));
|
2020-09-05 04:22:40 +10:00
|
|
|
}).catch(error => {
|
2017-01-19 21:06:06 +11:00
|
|
|
dispatch(fetchStatusFail(id, error, skipLoading));
|
2016-09-16 08:21:51 +10:00
|
|
|
});
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-16 08:21:51 +10:00
|
|
|
|
2018-03-24 23:06:27 +11:00
|
|
|
export function fetchStatusSuccess(skipLoading) {
|
2016-09-16 08:21:51 +10:00
|
|
|
return {
|
|
|
|
type: STATUS_FETCH_SUCCESS,
|
2017-05-21 01:31:47 +10:00
|
|
|
skipLoading,
|
2016-09-16 08:21:51 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-16 08:21:51 +10:00
|
|
|
|
2017-01-19 21:06:06 +11:00
|
|
|
export function fetchStatusFail(id, error, skipLoading) {
|
2016-09-16 08:21:51 +10:00
|
|
|
return {
|
|
|
|
type: STATUS_FETCH_FAIL,
|
2017-01-19 21:06:06 +11:00
|
|
|
id,
|
|
|
|
error,
|
2017-02-27 09:06:27 +11:00
|
|
|
skipLoading,
|
2017-05-21 01:31:47 +10:00
|
|
|
skipAlert: true,
|
2016-09-16 08:21:51 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-30 08:00:45 +10:00
|
|
|
|
2019-05-11 14:46:43 +10:00
|
|
|
export function redraft(status, raw_text) {
|
2018-06-05 08:17:38 +10:00
|
|
|
return {
|
|
|
|
type: REDRAFT,
|
|
|
|
status,
|
2019-05-11 14:46:43 +10:00
|
|
|
raw_text,
|
2018-06-05 08:17:38 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2018-06-05 08:17:38 +10:00
|
|
|
|
2024-07-20 01:26:44 +10:00
|
|
|
export const editStatus = (id) => (dispatch, getState) => {
|
2022-02-10 10:15:30 +11:00
|
|
|
let status = getState().getIn(['statuses', id]);
|
|
|
|
|
|
|
|
if (status.get('poll')) {
|
|
|
|
status = status.set('poll', getState().getIn(['polls', status.get('poll')]));
|
|
|
|
}
|
|
|
|
|
|
|
|
dispatch(fetchStatusSourceRequest());
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().get(`/api/v1/statuses/${id}/source`).then(response => {
|
2022-02-10 10:15:30 +11:00
|
|
|
dispatch(fetchStatusSourceSuccess());
|
2024-07-20 01:26:44 +10:00
|
|
|
ensureComposeIsVisible(getState);
|
2022-02-10 10:15:30 +11:00
|
|
|
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text));
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch(fetchStatusSourceFail(error));
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const fetchStatusSourceRequest = () => ({
|
|
|
|
type: STATUS_FETCH_SOURCE_REQUEST,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStatusSourceSuccess = () => ({
|
|
|
|
type: STATUS_FETCH_SOURCE_SUCCESS,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStatusSourceFail = error => ({
|
|
|
|
type: STATUS_FETCH_SOURCE_FAIL,
|
|
|
|
error,
|
|
|
|
});
|
|
|
|
|
2024-07-20 01:26:44 +10:00
|
|
|
export function deleteStatus(id, withRedraft = false) {
|
2016-09-30 08:00:45 +10:00
|
|
|
return (dispatch, getState) => {
|
2019-03-06 14:53:37 +11:00
|
|
|
let status = getState().getIn(['statuses', id]);
|
|
|
|
|
|
|
|
if (status.get('poll')) {
|
|
|
|
status = status.set('poll', getState().getIn(['polls', status.get('poll')]));
|
|
|
|
}
|
2018-06-05 08:17:38 +10:00
|
|
|
|
2016-09-30 08:00:45 +10:00
|
|
|
dispatch(deleteStatusRequest(id));
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().delete(`/api/v1/statuses/${id}`).then(response => {
|
2016-09-30 08:00:45 +10:00
|
|
|
dispatch(deleteStatusSuccess(id));
|
2016-10-31 01:06:43 +11:00
|
|
|
dispatch(deleteFromTimelines(id));
|
2020-07-20 01:04:02 +10:00
|
|
|
dispatch(importFetchedAccount(response.data.account));
|
2018-06-05 08:17:38 +10:00
|
|
|
|
|
|
|
if (withRedraft) {
|
2019-05-11 14:46:43 +10:00
|
|
|
dispatch(redraft(status, response.data.text));
|
2024-07-20 01:26:44 +10:00
|
|
|
ensureComposeIsVisible(getState);
|
2018-06-05 08:17:38 +10:00
|
|
|
}
|
2016-09-30 08:00:45 +10:00
|
|
|
}).catch(error => {
|
|
|
|
dispatch(deleteStatusFail(id, error));
|
|
|
|
});
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-30 08:00:45 +10:00
|
|
|
|
|
|
|
export function deleteStatusRequest(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_DELETE_REQUEST,
|
2017-05-21 01:31:47 +10:00
|
|
|
id: id,
|
2016-09-30 08:00:45 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-30 08:00:45 +10:00
|
|
|
|
|
|
|
export function deleteStatusSuccess(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_DELETE_SUCCESS,
|
2017-05-21 01:31:47 +10:00
|
|
|
id: id,
|
2016-09-30 08:00:45 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-09-30 08:00:45 +10:00
|
|
|
|
|
|
|
export function deleteStatusFail(id, error) {
|
|
|
|
return {
|
|
|
|
type: STATUS_DELETE_FAIL,
|
|
|
|
id: id,
|
2017-05-21 01:31:47 +10:00
|
|
|
error: error,
|
2016-09-30 08:00:45 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-10-31 01:06:43 +11:00
|
|
|
|
2022-01-20 08:37:27 +11:00
|
|
|
export const updateStatus = status => dispatch =>
|
|
|
|
dispatch(importFetchedStatus(status));
|
|
|
|
|
2016-10-31 01:06:43 +11:00
|
|
|
export function fetchContext(id) {
|
2024-05-23 00:45:18 +10:00
|
|
|
return (dispatch) => {
|
2016-10-31 01:06:43 +11:00
|
|
|
dispatch(fetchContextRequest(id));
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().get(`/api/v1/statuses/${id}/context`).then(response => {
|
2018-03-24 23:06:27 +11:00
|
|
|
dispatch(importFetchedStatuses(response.data.ancestors.concat(response.data.descendants)));
|
2016-10-31 01:06:43 +11:00
|
|
|
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants));
|
2017-02-27 09:06:27 +11:00
|
|
|
|
2016-10-31 01:06:43 +11:00
|
|
|
}).catch(error => {
|
2017-07-20 03:38:50 +10:00
|
|
|
if (error.response && error.response.status === 404) {
|
2017-02-19 21:54:27 +11:00
|
|
|
dispatch(deleteFromTimelines(id));
|
|
|
|
}
|
2017-02-27 09:06:27 +11:00
|
|
|
|
|
|
|
dispatch(fetchContextFail(id, error));
|
2016-10-31 01:06:43 +11:00
|
|
|
});
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-10-31 01:06:43 +11:00
|
|
|
|
|
|
|
export function fetchContextRequest(id) {
|
|
|
|
return {
|
|
|
|
type: CONTEXT_FETCH_REQUEST,
|
2017-05-21 01:31:47 +10:00
|
|
|
id,
|
2016-10-31 01:06:43 +11:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-10-31 01:06:43 +11:00
|
|
|
|
|
|
|
export function fetchContextSuccess(id, ancestors, descendants) {
|
|
|
|
return {
|
|
|
|
type: CONTEXT_FETCH_SUCCESS,
|
|
|
|
id,
|
|
|
|
ancestors,
|
|
|
|
descendants,
|
2017-05-21 01:31:47 +10:00
|
|
|
statuses: ancestors.concat(descendants),
|
2016-10-31 01:06:43 +11:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2016-10-31 01:06:43 +11:00
|
|
|
|
|
|
|
export function fetchContextFail(id, error) {
|
|
|
|
return {
|
|
|
|
type: CONTEXT_FETCH_FAIL,
|
|
|
|
id,
|
2017-02-27 09:06:27 +11:00
|
|
|
error,
|
2017-05-21 01:31:47 +10:00
|
|
|
skipAlert: true,
|
2016-10-31 01:06:43 +11:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function muteStatus(id) {
|
2024-05-23 00:45:18 +10:00
|
|
|
return (dispatch) => {
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
dispatch(muteStatusRequest(id));
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().post(`/api/v1/statuses/${id}/mute`).then(() => {
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
dispatch(muteStatusSuccess(id));
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch(muteStatusFail(id, error));
|
|
|
|
});
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function muteStatusRequest(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_MUTE_REQUEST,
|
2017-05-21 01:31:47 +10:00
|
|
|
id,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function muteStatusSuccess(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_MUTE_SUCCESS,
|
2017-05-21 01:31:47 +10:00
|
|
|
id,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function muteStatusFail(id, error) {
|
|
|
|
return {
|
|
|
|
type: STATUS_MUTE_FAIL,
|
|
|
|
id,
|
2017-05-21 01:31:47 +10:00
|
|
|
error,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function unmuteStatus(id) {
|
2024-05-23 00:45:18 +10:00
|
|
|
return (dispatch) => {
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
dispatch(unmuteStatusRequest(id));
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().post(`/api/v1/statuses/${id}/unmute`).then(() => {
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
dispatch(unmuteStatusSuccess(id));
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch(unmuteStatusFail(id, error));
|
|
|
|
});
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function unmuteStatusRequest(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_UNMUTE_REQUEST,
|
2017-05-21 01:31:47 +10:00
|
|
|
id,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function unmuteStatusSuccess(id) {
|
|
|
|
return {
|
|
|
|
type: STATUS_UNMUTE_SUCCESS,
|
2017-05-21 01:31:47 +10:00
|
|
|
id,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
|
|
|
|
export function unmuteStatusFail(id, error) {
|
|
|
|
return {
|
|
|
|
type: STATUS_UNMUTE_FAIL,
|
|
|
|
id,
|
2017-05-21 01:31:47 +10:00
|
|
|
error,
|
Feature conversations muting (#3017)
* Add <ostatus:conversation /> tag to Atom input/output
Only uses ref attribute (not href) because href would be
the alternate link that's always included also.
Creates new conversation for every non-reply status. Carries
over conversation for every reply. Keeps remote URIs verbatim,
generates local URIs on the fly like the rest of them.
* Conversation muting - prevents notifications that reference a conversation
(including replies, favourites, reblogs) from being created. API endpoints
/api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute
Currently no way to tell when a status/conversation is muted, so the web UI
only has a "disable notifications" button, doesn't work as a toggle
* Display "Dismiss notifications" on all statuses in notifications column, not just own
* Add "muted" as a boolean attribute on statuses JSON
For now always false on contained reblogs, since it's only relevant for
statuses returned from the notifications endpoint, which are not nested
Remove "Disable notifications" from detailed status view, since it's
only relevant in the notifications column
* Up max class length
* Remove pending test for conversation mute
* Add tests, clean up
* Rename to "mute conversation" and "unmute conversation"
* Raise validation error when trying to mute/unmute status without conversation
2017-05-15 11:04:13 +10:00
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2018-03-11 19:52:59 +11:00
|
|
|
|
|
|
|
export function hideStatus(ids) {
|
|
|
|
if (!Array.isArray(ids)) {
|
|
|
|
ids = [ids];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: STATUS_HIDE,
|
|
|
|
ids,
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2018-03-11 19:52:59 +11:00
|
|
|
|
|
|
|
export function revealStatus(ids) {
|
|
|
|
if (!Array.isArray(ids)) {
|
|
|
|
ids = [ids];
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: STATUS_REVEAL,
|
|
|
|
ids,
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
Summary: fix slowness due to layout thrashing when reloading a large … (#12661)
* Summary: fix slowness due to layout thrashing when reloading a large set of status updates
in order to limit the maximum size of a status in a list view (e.g. the home timeline), so as to avoid having to scroll all the way through an abnormally large status update (see https://github.com/tootsuite/mastodon/pull/8205), the following steps are taken:
•the element containing the status is rendered in the browser
•its height is calculated, to determine if it exceeds the maximum height threshold.
Unfortunately for performance, these steps are carried out in the componentDidMount(/Update) method, which also performs style modifications on the element. The combination of height request and style modification during javascript evaluation in the browser leads to layout-thrashing, where the elements are repeatedly re-laid-out (see https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing & https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers).
The solution implemented here is to memoize the collapsed state in Redux the first time the status is seen (e.g. when fetched as part of a small batch, to populate the home timeline) , so that on subsequent re-renders, the value can be queried, rather than recalculated. This strategy is derived from https://github.com/tootsuite/mastodon/pull/4439 & https://github.com/tootsuite/mastodon/pull/4909, and should resolve https://github.com/tootsuite/mastodon/issues/12455.
Andrew Lin (https://github.com/onethreeseven) is thanked for his assistance in root cause analysis and solution brainstorming
* remove getSnapshotBeforeUpdate from status
* remove componentWillUnmount from status
* persist last-intersected status update and restore when ScrollableList is restored
e.g. when navigating from home-timeline to a status conversational thread and <Back again
* cache currently-viewing status id to avoid calling redux with identical value
* refactor collapse toggle to pass explicit boolean
2019-12-29 15:39:48 +11:00
|
|
|
|
2024-07-23 02:03:58 +10:00
|
|
|
export function toggleStatusSpoilers(statusId) {
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
const status = getState().statuses.get(statusId);
|
|
|
|
|
|
|
|
if (!status)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (status.get('hidden')) {
|
|
|
|
dispatch(revealStatus(statusId));
|
|
|
|
} else {
|
|
|
|
dispatch(hideStatus(statusId));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
Summary: fix slowness due to layout thrashing when reloading a large … (#12661)
* Summary: fix slowness due to layout thrashing when reloading a large set of status updates
in order to limit the maximum size of a status in a list view (e.g. the home timeline), so as to avoid having to scroll all the way through an abnormally large status update (see https://github.com/tootsuite/mastodon/pull/8205), the following steps are taken:
•the element containing the status is rendered in the browser
•its height is calculated, to determine if it exceeds the maximum height threshold.
Unfortunately for performance, these steps are carried out in the componentDidMount(/Update) method, which also performs style modifications on the element. The combination of height request and style modification during javascript evaluation in the browser leads to layout-thrashing, where the elements are repeatedly re-laid-out (see https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing & https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers).
The solution implemented here is to memoize the collapsed state in Redux the first time the status is seen (e.g. when fetched as part of a small batch, to populate the home timeline) , so that on subsequent re-renders, the value can be queried, rather than recalculated. This strategy is derived from https://github.com/tootsuite/mastodon/pull/4439 & https://github.com/tootsuite/mastodon/pull/4909, and should resolve https://github.com/tootsuite/mastodon/issues/12455.
Andrew Lin (https://github.com/onethreeseven) is thanked for his assistance in root cause analysis and solution brainstorming
* remove getSnapshotBeforeUpdate from status
* remove componentWillUnmount from status
* persist last-intersected status update and restore when ScrollableList is restored
e.g. when navigating from home-timeline to a status conversational thread and <Back again
* cache currently-viewing status id to avoid calling redux with identical value
* refactor collapse toggle to pass explicit boolean
2019-12-29 15:39:48 +11:00
|
|
|
export function toggleStatusCollapse(id, isCollapsed) {
|
|
|
|
return {
|
|
|
|
type: STATUS_COLLAPSE,
|
|
|
|
id,
|
|
|
|
isCollapsed,
|
|
|
|
};
|
2022-12-19 02:51:37 +11:00
|
|
|
}
|
2022-09-24 07:00:12 +10:00
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
export const translateStatus = id => (dispatch) => {
|
2022-09-24 07:00:12 +10:00
|
|
|
dispatch(translateStatusRequest(id));
|
|
|
|
|
2024-05-23 00:45:18 +10:00
|
|
|
api().post(`/api/v1/statuses/${id}/translate`).then(response => {
|
2022-09-24 07:00:12 +10:00
|
|
|
dispatch(translateStatusSuccess(id, response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
dispatch(translateStatusFail(id, error));
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const translateStatusRequest = id => ({
|
|
|
|
type: STATUS_TRANSLATE_REQUEST,
|
|
|
|
id,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const translateStatusSuccess = (id, translation) => ({
|
|
|
|
type: STATUS_TRANSLATE_SUCCESS,
|
|
|
|
id,
|
|
|
|
translation,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const translateStatusFail = (id, error) => ({
|
|
|
|
type: STATUS_TRANSLATE_FAIL,
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
});
|
|
|
|
|
2023-06-01 08:10:21 +10:00
|
|
|
export const undoStatusTranslation = (id, pollId) => ({
|
2022-09-24 07:00:12 +10:00
|
|
|
type: STATUS_TRANSLATE_UNDO,
|
|
|
|
id,
|
2023-06-01 08:10:21 +10:00
|
|
|
pollId,
|
2022-09-24 07:00:12 +10:00
|
|
|
});
|