Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Apr 27, 2024
1 parent 3248554 commit cfda23e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/common/features/polls/api/get-poll-details-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function useGetPollDetailsQuery(entry?: Entry) {
queryFn: () =>
axios
.get(
`https://polls.hivehub.dev/rpc/poll?author=eq.${entry!!.author}&permlink=eq.${
`https://polls.ecency.com/rpc/poll?author=eq.${entry!!.author}&permlink=eq.${
entry!!.permlink
}`
)
Expand Down
4 changes: 2 additions & 2 deletions src/common/features/polls/components/poll-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export function PollWidget({ poll, isReadOnly, entry }: Props) {
const endTimeFullDate = useMemo(() => format(poll.endTime, "dd.MM.yyyy HH:mm"), [poll.endTime]);
const isFinished = useMemo(() => isBefore(poll.endTime, new Date()), [poll.endTime]);
const showViewVotes = useMemo(
() => poll.hide_votes && !resultsMode,
[poll.hide_votes, resultsMode]
() => poll.hideVotes && !resultsMode,
[poll.hideVotes, resultsMode]
);
const showChangeVote = useMemo(
() => poll.voteChange && resultsMode && pollDetails.data?.status === "Active",
Expand Down
8 changes: 4 additions & 4 deletions src/common/features/polls/components/polls-creation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface PollSnapshot {
title: string;
choices: string[];
voteChange: boolean;
hide_votes: boolean;
hideVotes: boolean;
filters: {
accountAge: number;
};
Expand Down Expand Up @@ -57,7 +57,7 @@ export function PollsCreation({
setEndDate,
interpretation,
setInterpretation,
hide_votes,
hideVotes,
setHideVotes,
voteChange,
setVoteChange,
Expand Down Expand Up @@ -173,7 +173,7 @@ export function PollsCreation({
disabled={readonly}
type="checkbox"
label={_t("polls.current-standing")}
checked={!!hide_votes}
checked={!!hideVotes}
onChange={(e: boolean) => setHideVotes(e)}
/>
</div>
Expand Down Expand Up @@ -223,7 +223,7 @@ export function PollsCreation({
endTime: endDate,
choices,
voteChange: !!voteChange,
hide_votes: !!hide_votes,
hideVotes: !!hideVotes,
filters: {
accountAge
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function usePollsCreationManagement(poll?: PollSnapshot) {
setEndDate(poll.endTime);
setInterpretation(poll.interpretation);
setVoteChange(poll.voteChange);
setHideVotes(poll.hide_votes);
setHideVotes(poll.hideVotes);
}
}, [poll]);

Expand Down Expand Up @@ -75,7 +75,7 @@ export function usePollsCreationManagement(poll?: PollSnapshot) {
setEndDate,
interpretation,
setInterpretation,
hide_votes,
hideVotes,
setHideVotes,
voteChange,
setVoteChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function buildPollJsonMetadata(poll: PollSnapshot) {
choices: poll.choices,
preferred_interpretation: poll.interpretation,
token: null,
hide_votes: poll.hide_votes,
hide_votes: poll.hideVotes,
vote_change: poll.voteChange,
filters: {
account_age: poll.filters.accountAge
Expand Down
2 changes: 1 addition & 1 deletion src/common/pages/entry/utils/use-entry-poll-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function useEntryPollExtractor(entry?: Entry | null) {
endTime: new Date((entry.json_metadata as JsonPollMetadata)?.end_time * 1000),
interpretation: (entry.json_metadata as JsonPollMetadata)?.preferred_interpretation,
voteChange: (entry.json_metadata as JsonPollMetadata)?.vote_change ?? true,
hide_votes: (entry.json_metadata as JsonPollMetadata)?.hide_votes ?? false,
hideVotes: (entry.json_metadata as JsonPollMetadata)?.hide_votes ?? false,
filters: {
accountAge: (entry.json_metadata as JsonPollMetadata)?.filters.account_age
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/store/entries/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface JsonPollMetadata {
preferred_interpretation: string;
token: string;
vote_change: boolean;
current_standing: boolean;
hide_votes: boolean;
filters: { account_age: number };
end_time: number;
}
Expand Down

0 comments on commit cfda23e

Please sign in to comment.