Merge pull request #254 from Reeywhaar/252-fix
Fix wrong label on voting buttons
This commit is contained in:
@@ -360,6 +360,7 @@ export default class Comment extends Component {
|
||||
* @return {(string|null)}
|
||||
*/
|
||||
getVoteDisabledReason() {
|
||||
if (this.props.mods && this.props.mods.view === 'user') return 'Voting disabled in last comments';
|
||||
if (this.isGuest()) return 'Only authorized users are allowed to vote';
|
||||
const info = store.get('info');
|
||||
if (info && info.read_only) return "You can't vote on read-only topics";
|
||||
@@ -621,9 +622,11 @@ export default class Comment extends Component {
|
||||
|
||||
{isCopied && <span className="comment__control comment__control_view_inactive">Copied!</span>}
|
||||
|
||||
<span {...getHandleClickProps(() => this.togglePin(pinned))} className="comment__control">
|
||||
{pinned ? 'Unpin' : 'Pin'}
|
||||
</span>
|
||||
{mods.view !== 'user' && (
|
||||
<span {...getHandleClickProps(() => this.togglePin(pinned))} className="comment__control">
|
||||
{pinned ? 'Unpin' : 'Pin'}
|
||||
</span>
|
||||
)}
|
||||
|
||||
{userBlocked && (
|
||||
<span {...getHandleClickProps(() => this.onUnblockUserClick())} className="comment__control">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { h, Component } from 'preact';
|
||||
import { connect } from 'preact-redux';
|
||||
|
||||
import store from 'common/store';
|
||||
import api from 'common/api';
|
||||
import LastCommentsList from './last-comments-list';
|
||||
import Avatar from 'components/avatar-icon';
|
||||
@@ -21,6 +22,11 @@ class UserInfo extends Component {
|
||||
if (!comments && !isLoading) {
|
||||
fetchComments(id);
|
||||
|
||||
api
|
||||
.getUser()
|
||||
.then(data => store.set('user', data))
|
||||
.catch(() => store.set('user', {}));
|
||||
|
||||
api
|
||||
.getUserComments({ user: id, limit: 10 })
|
||||
.then(({ comments }) => completeFetchComments(id, comments))
|
||||
|
||||
+2
-1
@@ -49,7 +49,8 @@ function init() {
|
||||
isDefaultPicture: params.isDefaultPicture != 0,
|
||||
picture: params.picture,
|
||||
};
|
||||
store.set('user', user);
|
||||
store.set('user', {});
|
||||
store.set('target-user', user);
|
||||
const onClose = () => {
|
||||
if (window.parent) {
|
||||
window.parent.postMessage(JSON.stringify({ isUserInfoShown: false }), '*');
|
||||
|
||||
Reference in New Issue
Block a user