Merge pull request #3601 from glitch-soc/glitch-soc/merge-4.6

Merge upstream changes up to 9e5f298350 into stable-4.6
This commit is contained in:
Claire
2026-07-27 13:12:04 +02:00
committed by GitHub
6 changed files with 10 additions and 10 deletions
@@ -9,7 +9,7 @@ export interface ApiPollOptionJSON {
export interface ApiPollJSON {
id: string;
expires_at: string;
expires_at: string | null;
expired: boolean;
multiple: boolean;
votes_count: number;
@@ -36,7 +36,7 @@ const messages = defineMessages({
});
const isPollExpired = (expiresAt: Model.Poll['expires_at']) =>
new Date(expiresAt).getTime() < Date.now();
expiresAt !== null && new Date(expiresAt).getTime() < Date.now();
interface PollProps {
pollId: string;
@@ -64,7 +64,7 @@ export const Poll: React.FC<PollProps> = ({ pollId, disabled, status }) => {
return poll.expired || isPollExpired(poll.expires_at);
}, [poll]);
const timeRemaining = useMemo(() => {
if (!poll) {
if (!poll?.expires_at) {
return null;
}
if (expired) {
@@ -76,8 +76,8 @@ function getStatusResultFunction(
status: statusBase.withMutations(map => {
map.set('reblog', statusReblog);
map.set('account', accountBase);
map.set('matched_filters', filtered);
map.set('matched_media_filters', mediaFiltered);
map.set('matched_filters', filtered ? filtered.toJS() : false);
map.set('matched_media_filters', mediaFiltered ? mediaFiltered.toJS() : false);
}),
loadingState: statusBase.get('isLoading') ? 'loading' : 'complete'
};
+1 -1
View File
@@ -9,7 +9,7 @@ export interface ApiPollOptionJSON {
export interface ApiPollJSON {
id: string;
expires_at: string;
expires_at: string | null;
expired: boolean;
multiple: boolean;
votes_count: number;
+2 -2
View File
@@ -36,7 +36,7 @@ const messages = defineMessages({
});
const isPollExpired = (expiresAt: Model.Poll['expires_at']) =>
new Date(expiresAt).getTime() < Date.now();
expiresAt !== null && new Date(expiresAt).getTime() < Date.now();
interface PollProps {
pollId: string;
@@ -64,7 +64,7 @@ export const Poll: React.FC<PollProps> = ({ pollId, disabled, status }) => {
return poll.expired || isPollExpired(poll.expires_at);
}, [poll]);
const timeRemaining = useMemo(() => {
if (!poll) {
if (!poll?.expires_at) {
return null;
}
if (expired) {
+2 -2
View File
@@ -75,8 +75,8 @@ function getStatusResultFunction(
status: statusBase.withMutations(map => {
map.set('reblog', statusReblog);
map.set('account', accountBase);
map.set('matched_filters', filtered);
map.set('matched_media_filters', mediaFiltered);
map.set('matched_filters', filtered ? filtered.toJS() : false);
map.set('matched_media_filters', mediaFiltered ? mediaFiltered.toJS() : false);
}),
loadingState: statusBase.get('isLoading') ? 'loading' : 'complete'
};