mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-24 18:15:20 +00:00
commit
b1158b9f73
|
@ -426,7 +426,7 @@ export class Signup extends Component<any, State> {
|
||||||
this.state = this.emptyState;
|
this.state = this.emptyState;
|
||||||
this.state.registerForm.captcha_answer = undefined;
|
this.state.registerForm.captcha_answer = undefined;
|
||||||
// Refetch another captcha
|
// Refetch another captcha
|
||||||
WebSocketService.Instance.send(wsClient.getCaptcha());
|
// WebSocketService.Instance.send(wsClient.getCaptcha());
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -606,7 +606,7 @@ export class Profile extends Component<any, ProfileState> {
|
||||||
if (
|
if (
|
||||||
UserService.Instance.myUserInfo &&
|
UserService.Instance.myUserInfo &&
|
||||||
data.comment_view.creator.id ==
|
data.comment_view.creator.id ==
|
||||||
UserService.Instance.myUserInfo.local_user_view.person.id
|
UserService.Instance.myUserInfo?.local_user_view.person.id
|
||||||
) {
|
) {
|
||||||
toast(i18n.t("reply_sent"));
|
toast(i18n.t("reply_sent"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,7 @@ export class Post extends Component<any, PostState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
isBottom(el: Element) {
|
isBottom(el: Element) {
|
||||||
return el.getBoundingClientRect().bottom <= window.innerHeight;
|
return el?.getBoundingClientRect().bottom <= window.innerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -277,7 +277,7 @@ export class Post extends Component<any, PostState> {
|
||||||
*/
|
*/
|
||||||
trackCommentsBoxScrolling = () => {
|
trackCommentsBoxScrolling = () => {
|
||||||
const wrappedElement = document.getElementsByClassName("comments")[0];
|
const wrappedElement = document.getElementsByClassName("comments")[0];
|
||||||
if (this.isBottom(wrappedElement)) {
|
if (wrappedElement && this.isBottom(wrappedElement)) {
|
||||||
this.state.maxCommentsShown += commentsShownInterval;
|
this.state.maxCommentsShown += commentsShownInterval;
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -809,10 +809,14 @@ export class Search extends Component<any, SearchState> {
|
||||||
this.creatorChoices.passedElement.element.addEventListener(
|
this.creatorChoices.passedElement.element.addEventListener(
|
||||||
"search",
|
"search",
|
||||||
debounce(async (e: any) => {
|
debounce(async (e: any) => {
|
||||||
let creators = (await fetchUsers(e.detail.value)).users;
|
try {
|
||||||
let choices = creators.map(pvs => personToChoice(pvs));
|
let creators = (await fetchUsers(e.detail.value)).users;
|
||||||
choices.unshift({ value: "0", label: i18n.t("all") });
|
let choices = creators.map(pvs => personToChoice(pvs));
|
||||||
this.creatorChoices.setChoices(choices, "value", "label", true);
|
choices.unshift({ value: "0", label: i18n.t("all") });
|
||||||
|
this.creatorChoices.setChoices(choices, "value", "label", true);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
}, 400),
|
}, 400),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue