Poll refreshing #53

Open
leah wants to merge 6 commits from cherrypick/refresh-polls into main
Showing only changes of commit 29bba2ee30 - Show all commits

View file

@ -22,8 +22,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="isVoted">{{ i18n.ts._poll.voted }}</span>
<span v-else-if="closed">{{ i18n.ts._poll.closed }}</span>
<span v-if="remaining > 0"> · {{ timer }}</span>
<span v-if="!closed && $i && !props.local"> · </span>
<a v-if="!closed && $i && !props.local" style="color: inherit;" @click="refreshVotes()">{{ i18n.ts.reload }}</a>
<span v-if="$i && !props.local"> · </span>
<a v-if="$i && !props.local" style="color: inherit;" @click="refreshVotes()">{{ i18n.ts.reload }}</a>
</p>
</div>
</template>
@ -98,9 +98,9 @@ const vote = async (id) => {
};
const refreshVotes = async () => {
pleaseLogin(undefined, pleaseLoginContext.value);
pleaseLogin();
if (props.readOnly || closed.value) return;
if (props.readOnly) return;
await misskeyApi('notes/polls/refresh', {
noteId: props.noteId,
// Sadly due to being in the same component and the poll being a prop we require to break Vue's recommendation of not mutating the prop to update it.