From 78856561ab0cf948a858d9197ca424c75ad769cf Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 6 Jun 2023 00:52:42 -0400 Subject: [PATCH 1/3] Reworking some more forms. --- .../components/comment/comment-form.tsx | 12 +- .../components/comment/comment-node.tsx | 10 +- .../components/comment/comment-nodes.tsx | 10 +- .../components/community/community-form.tsx | 14 +- src/shared/components/community/sidebar.tsx | 6 +- src/shared/components/home/admin-settings.tsx | 13 ++ src/shared/components/home/setup.tsx | 19 ++- src/shared/components/home/site-form.tsx | 120 +++++++----------- .../components/person/person-details.tsx | 6 +- src/shared/components/post/post-form.tsx | 11 +- 10 files changed, 97 insertions(+), 124 deletions(-) diff --git a/src/shared/components/comment/comment-form.tsx b/src/shared/components/comment/comment-form.tsx index 510d1c60..cf0a0071 100644 --- a/src/shared/components/comment/comment-form.tsx +++ b/src/shared/components/comment/comment-form.tsx @@ -1,16 +1,10 @@ import { Component } from "inferno"; import { T } from "inferno-i18next-dess"; import { Link } from "inferno-router"; -import { - CommentResponse, - CreateComment, - EditComment, - Language, -} from "lemmy-js-client"; +import { CreateComment, EditComment, Language } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { CommentNodeI } from "../../interfaces"; import { UserService } from "../../services"; -import { RequestState } from "../../services/HttpService"; import { capitalizeFirstLetter, myAuthRequired } from "../../utils"; import { Icon } from "../common/icon"; import { MarkdownTextArea } from "../common/markdown-textarea"; @@ -27,9 +21,7 @@ interface CommentFormProps { onReplyCancel?(): void; allLanguages: Language[]; siteLanguages: number[]; - onUpsertComment( - form: EditComment | CreateComment - ): Promise>; + onUpsertComment(form: EditComment | CreateComment): void; } export class CommentForm extends Component { diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 331648d0..72ef952f 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -9,7 +9,6 @@ import { BlockPerson, CommentId, CommentReplyView, - CommentResponse, CommentView, CommunityModeratorView, CreateComment, @@ -40,7 +39,6 @@ import { VoteType, } from "../../interfaces"; import { UserService } from "../../services"; -import { RequestState } from "../../services/HttpService"; import { amCommunityCreator, canAdmin, @@ -128,12 +126,8 @@ interface CommentNodeProps { onSaveComment(form: SaveComment): void; onCommentReplyRead(form: MarkCommentReplyAsRead): void; onPersonMentionRead(form: MarkPersonMentionAsRead): void; - onCreateComment( - form: EditComment | CreateComment - ): Promise>; - onEditComment( - form: EditComment | CreateComment - ): Promise>; + onCreateComment(form: EditComment | CreateComment): void; + onEditComment(form: EditComment | CreateComment): void; onCommentVote(form: CreateCommentLike): void; onBlockPerson(form: BlockPerson): void; onDeleteComment(form: DeleteComment): void; diff --git a/src/shared/components/comment/comment-nodes.tsx b/src/shared/components/comment/comment-nodes.tsx index c8685ebd..cee85cd1 100644 --- a/src/shared/components/comment/comment-nodes.tsx +++ b/src/shared/components/comment/comment-nodes.tsx @@ -6,7 +6,6 @@ import { BanPerson, BlockPerson, CommentId, - CommentResponse, CommunityModeratorView, CreateComment, CreateCommentLike, @@ -26,7 +25,6 @@ import { TransferCommunity, } from "lemmy-js-client"; import { CommentNodeI, CommentViewType } from "../../interfaces"; -import { RequestState } from "../../services/HttpService"; import { CommentNode } from "./comment-node"; interface CommentNodesProps { @@ -50,12 +48,8 @@ interface CommentNodesProps { onSaveComment(form: SaveComment): void; onCommentReplyRead(form: MarkCommentReplyAsRead): void; onPersonMentionRead(form: MarkPersonMentionAsRead): void; - onCreateComment( - form: EditComment | CreateComment - ): Promise>; - onEditComment( - form: EditComment | CreateComment - ): Promise>; + onCreateComment(form: EditComment | CreateComment): void; + onEditComment(form: EditComment | CreateComment): void; onCommentVote(form: CreateCommentLike): void; onBlockPerson(form: BlockPerson): void; onDeleteComment(form: DeleteComment): void; diff --git a/src/shared/components/community/community-form.tsx b/src/shared/components/community/community-form.tsx index 72cdb3fb..6171ec95 100644 --- a/src/shared/components/community/community-form.tsx +++ b/src/shared/components/community/community-form.tsx @@ -1,7 +1,6 @@ import { Component, linkEvent } from "inferno"; import { Prompt } from "inferno-router"; import { - CommunityResponse, CommunityView, CreateCommunity, EditCommunity, @@ -9,7 +8,6 @@ import { } from "lemmy-js-client"; import { Subscription } from "rxjs"; import { i18n } from "../../i18next"; -import { RequestState } from "../../services/HttpService"; import { capitalizeFirstLetter, myAuthRequired, randomStr } from "../../utils"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; @@ -22,9 +20,7 @@ interface CommunityFormProps { siteLanguages: number[]; communityLanguages?: number[]; onCancel?(): any; - onUpsertCommunity( - form: CreateCommunity | EditCommunity - ): Promise>; + onUpsertCommunity(form: CreateCommunity | EditCommunity): void; enableNsfw?: boolean; } @@ -288,7 +284,7 @@ export class CommunityForm extends Component< ); } - async handleCreateCommunitySubmit(i: CommunityForm, event: any) { + handleCreateCommunitySubmit(i: CommunityForm, event: any) { event.preventDefault(); i.setState({ loading: true }); const cForm = i.state.form; @@ -297,7 +293,7 @@ export class CommunityForm extends Component< const cv = i.props.community_view; if (cv) { - await i.props.onUpsertCommunity({ + i.props.onUpsertCommunity({ community_id: cv.community.id, title: cForm.title, description: cForm.description, @@ -310,7 +306,7 @@ export class CommunityForm extends Component< }); } else { if (cForm.title && cForm.name) { - await i.props.onUpsertCommunity({ + i.props.onUpsertCommunity({ name: cForm.name, title: cForm.title, description: cForm.description, @@ -323,8 +319,6 @@ export class CommunityForm extends Component< }); } } - - i.setState({ loading: false }); } handleCommunityNameChange(i: CommunityForm, event: any) { diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index e3bb297b..760785c1 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -4,7 +4,6 @@ import { AddModToCommunity, BlockCommunity, CommunityModeratorView, - CommunityResponse, CommunityView, DeleteCommunity, EditCommunity, @@ -16,7 +15,6 @@ import { } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { UserService } from "../../services"; -import { RequestState } from "../../services/HttpService"; import { amAdmin, amMod, @@ -50,9 +48,7 @@ interface SidebarProps { onFollowCommunity(form: FollowCommunity): void; onBlockCommunity(form: BlockCommunity): void; onPurgeCommunity(form: PurgeCommunity): void; - onEditCommunity( - form: EditCommunity - ): Promise>; + onEditCommunity(form: EditCommunity): void; } interface SidebarState { diff --git a/src/shared/components/home/admin-settings.tsx b/src/shared/components/home/admin-settings.tsx index 1dd7d665..649eb64e 100644 --- a/src/shared/components/home/admin-settings.tsx +++ b/src/shared/components/home/admin-settings.tsx @@ -20,6 +20,7 @@ import { } from "../../services/HttpService"; import { capitalizeFirstLetter, + fetchThemeList, isInitialRoute, myAuthRequired, removeFromEmojiDataModel, @@ -44,6 +45,7 @@ interface AdminSettingsState { instancesRes: RequestState; bannedRes: RequestState; leaveAdminTeamRes: RequestState; + themeList: RequestState; } export class AdminSettings extends Component { @@ -55,6 +57,7 @@ export class AdminSettings extends Component { bannedRes: { state: "empty" }, instancesRes: { state: "empty" }, leaveAdminTeamRes: { state: "empty" }, + themeList: { state: "empty" }, }; constructor(props: any, context: any) { @@ -75,6 +78,7 @@ export class AdminSettings extends Component { instancesRes: apiWrapperIso( this.isoData.routeData[1] as GetFederatedInstancesResponse ), + themeList: apiWrapperIso(this.isoData.routeData[2] as string[]), }; } } @@ -83,6 +87,7 @@ export class AdminSettings extends Component { this.setState({ bannedRes: { state: "loading" }, instancesRes: { state: "loading" }, + themeList: { state: "loading" }, }); const auth = myAuthRequired(); @@ -98,6 +103,7 @@ export class AdminSettings extends Component { auth, }) ), + themeList: await apiWrapper(fetchThemeList()), }); } @@ -109,6 +115,7 @@ export class AdminSettings extends Component { let bannedPersonsForm: GetBannedPersons = { auth }; promises.push(req.client.getBannedPersons(bannedPersonsForm)); promises.push(req.client.getFederatedInstances({ auth })); + promises.push(fetchThemeList()); } return promises; @@ -131,6 +138,10 @@ export class AdminSettings extends Component { this.state.instancesRes.state === "success" ? this.state.instancesRes.data.federated_instances : undefined; + const themeList = + this.state.themeList.state == "success" + ? this.state.themeList.data + : undefined; return (
@@ -151,6 +162,8 @@ export class AdminSettings extends Component { allowedInstances={federationData?.allowed} blockedInstances={federationData?.blocked} onSaveSite={this.handleEditSite} + siteRes={this.state.siteRes} + themeList={themeList} />
diff --git a/src/shared/components/home/setup.tsx b/src/shared/components/home/setup.tsx index 5ecd6e3c..fc820ebd 100644 --- a/src/shared/components/home/setup.tsx +++ b/src/shared/components/home/setup.tsx @@ -13,7 +13,7 @@ import { RequestState, apiWrapper, } from "../../services/HttpService"; -import { setIsoData } from "../../utils"; +import { fetchThemeList, setIsoData } from "../../utils"; import { Spinner } from "../common/icon"; import { SiteForm } from "./site-form"; @@ -31,6 +31,7 @@ interface State { }; doneRegisteringUser: boolean; registerRes: RequestState; + themeList: RequestState; siteRes: GetSiteResponse; } @@ -39,6 +40,7 @@ export class Setup extends Component { state: State = { registerRes: { state: "empty" }, + themeList: { state: "empty" }, form: { show_nsfw: true, }, @@ -52,11 +54,19 @@ export class Setup extends Component { this.handleCreateSite = this.handleCreateSite.bind(this); } + async componentDidMount() { + this.setState({ themeList: await apiWrapper(fetchThemeList()) }); + } + get documentTitle(): string { return `${i18n.t("setup")} - Lemmy`; } render() { + const themeList = + this.state.themeList.state == "success" + ? this.state.themeList.data + : undefined; return (
@@ -66,7 +76,12 @@ export class Setup extends Component { {!this.state.doneRegisteringUser ? ( this.registerUser() ) : ( - + )}
diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 4811bbbf..92106d35 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -11,16 +11,9 @@ import { GetSiteResponse, Instance, ListingType, - SiteResponse, } from "lemmy-js-client"; import { i18n } from "../../i18next"; -import { RequestState } from "../../services/HttpService"; -import { - capitalizeFirstLetter, - fetchThemeList, - myAuthRequired, - setIsoData, -} from "../../utils"; +import { capitalizeFirstLetter, myAuthRequired } from "../../utils"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; import { LanguageSelect } from "../common/language-select"; @@ -31,29 +24,25 @@ interface SiteFormProps { blockedInstances?: Instance[]; allowedInstances?: Instance[]; showLocal?: boolean; - onSaveSite(form: EditSite): Promise>; + themeList?: string[]; + onSaveSite(form: EditSite): void; + siteRes: GetSiteResponse; } interface SiteFormState { siteForm: EditSite; loading: boolean; - themeList?: string[]; instance_select: { allowed_instances: string; blocked_instances: string; }; - siteRes: GetSiteResponse; } type InstanceKey = "allowed_instances" | "blocked_instances"; export class SiteForm extends Component { - private isoData = setIsoData(this.context); state: SiteFormState = { - siteRes: this.isoData.site_res, - siteForm: { - auth: "TODO", - }, + siteForm: this.initSiteForm(), loading: false, instance_select: { allowed_instances: "", @@ -61,6 +50,42 @@ export class SiteForm extends Component { }, }; + initSiteForm(): EditSite { + const site = this.props.siteRes.site_view.site; + const ls = this.props.siteRes.site_view.local_site; + return { + name: site.name, + sidebar: site.sidebar, + description: site.description, + enable_downvotes: ls.enable_downvotes, + registration_mode: ls.registration_mode, + enable_nsfw: ls.enable_nsfw, + community_creation_admin_only: ls.community_creation_admin_only, + icon: site.icon, + banner: site.banner, + require_email_verification: ls.require_email_verification, + application_question: ls.application_question, + private_instance: ls.private_instance, + default_theme: ls.default_theme, + default_post_listing_type: ls.default_post_listing_type, + legal_information: ls.legal_information, + application_email_admins: ls.application_email_admins, + reports_email_admins: ls.reports_email_admins, + hide_modlog_mod_names: ls.hide_modlog_mod_names, + discussion_languages: this.props.siteRes.discussion_languages, + slur_filter_regex: ls.slur_filter_regex, + actor_name_max_length: ls.actor_name_max_length, + federation_enabled: ls.federation_enabled, + federation_debug: ls.federation_debug, + federation_worker_count: ls.federation_worker_count, + captcha_enabled: ls.captcha_enabled, + captcha_difficulty: ls.captcha_difficulty, + allowed_instances: this.props.allowedInstances?.map(i => i.domain), + blocked_instances: this.props.blockedInstances?.map(i => i.domain), + auth: "TODO", + }; + } + constructor(props: any, context: any) { super(props, context); @@ -83,47 +108,6 @@ export class SiteForm extends Component { this.handleAddInstance = this.handleAddInstance.bind(this); this.handleInstanceEnterPress = this.handleInstanceEnterPress.bind(this); this.handleInstanceTextChange = this.handleInstanceTextChange.bind(this); - - const site = this.state.siteRes.site_view.site; - const ls = this.state.siteRes.site_view.local_site; - this.state = { - ...this.state, - siteForm: { - name: site.name, - sidebar: site.sidebar, - description: site.description, - enable_downvotes: ls.enable_downvotes, - registration_mode: ls.registration_mode, - enable_nsfw: ls.enable_nsfw, - community_creation_admin_only: ls.community_creation_admin_only, - icon: site.icon, - banner: site.banner, - require_email_verification: ls.require_email_verification, - application_question: ls.application_question, - private_instance: ls.private_instance, - default_theme: ls.default_theme, - default_post_listing_type: ls.default_post_listing_type, - legal_information: ls.legal_information, - application_email_admins: ls.application_email_admins, - reports_email_admins: ls.reports_email_admins, - hide_modlog_mod_names: ls.hide_modlog_mod_names, - discussion_languages: this.state.siteRes.discussion_languages, - slur_filter_regex: ls.slur_filter_regex, - actor_name_max_length: ls.actor_name_max_length, - federation_enabled: ls.federation_enabled, - federation_debug: ls.federation_debug, - federation_worker_count: ls.federation_worker_count, - captcha_enabled: ls.captcha_enabled, - captcha_difficulty: ls.captcha_difficulty, - allowed_instances: this.props.allowedInstances?.map(i => i.domain), - blocked_instances: this.props.blockedInstances?.map(i => i.domain), - auth: "TODO", - }, - }; - } - - async componentDidMount() { - this.setState({ themeList: await fetchThemeList() }); } // Necessary to stop the loading @@ -134,7 +118,7 @@ export class SiteForm extends Component { componentDidUpdate() { if ( !this.state.loading && - !this.state.siteRes.site_view.local_site.site_setup && + !this.props.siteRes.site_view.local_site.site_setup && (this.state.siteForm.name || this.state.siteForm.sidebar || this.state.siteForm.application_question || @@ -151,7 +135,7 @@ export class SiteForm extends Component { } render() { - let siteSetup = this.state.siteRes.site_view.local_site.site_setup; + let siteSetup = this.props.siteRes.site_view.local_site.site_setup; return ( <> { className="custom-select w-auto" > - {this.state.themeList?.map(theme => ( + {this.props.themeList?.map(theme => ( @@ -511,8 +495,8 @@ export class SiteForm extends Component { { } } - async handleSaveSiteSubmit(i: SiteForm, event: any) { + handleSaveSiteSubmit(i: SiteForm, event: any) { event.preventDefault(); const auth = myAuthRequired(); i.setState(s => ((s.siteForm.auth = auth), s)); @@ -758,7 +742,7 @@ export class SiteForm extends Component { let form: EditSite | CreateSite; - if (i.state.siteRes.site_view.local_site.site_setup) { + if (i.props.siteRes.site_view.local_site.site_setup) { form = stateSiteForm; } else { form = { @@ -810,13 +794,7 @@ export class SiteForm extends Component { }; } - const res = await i.props.onSaveSite(form); - - if (res.state === "success") { - i.setState(s => ((s.siteRes.site_view = res.data.site_view), s)); - } - - i.setState({ loading: false }); + i.props.onSaveSite(form); } handleAddInstance(key: InstanceKey) { diff --git a/src/shared/components/person/person-details.tsx b/src/shared/components/person/person-details.tsx index 3d0fb3e9..4ff6fc5d 100644 --- a/src/shared/components/person/person-details.tsx +++ b/src/shared/components/person/person-details.tsx @@ -6,7 +6,6 @@ import { BanPerson, BlockPerson, CommentId, - CommentResponse, CommentView, CreateComment, CreateCommentLike, @@ -37,7 +36,6 @@ import { TransferCommunity, } from "lemmy-js-client"; import { CommentViewType, PersonDetailsView } from "../../interfaces"; -import { RequestState } from "../../services/HttpService"; import { commentsToFlatNodes, setupTippy } from "../../utils"; import { CommentNodes } from "../comment/comment-nodes"; import { Paginator } from "../common/paginator"; @@ -59,8 +57,8 @@ interface PersonDetailsProps { onSaveComment(form: SaveComment): void; onCommentReplyRead(form: MarkCommentReplyAsRead): void; onPersonMentionRead(form: MarkPersonMentionAsRead): void; - onCreateComment(form: CreateComment): Promise>; - onEditComment(form: EditComment): Promise>; + onCreateComment(form: CreateComment): void; + onEditComment(form: EditComment): void; onCommentVote(form: CreateCommentLike): void; onBlockPerson(form: BlockPerson): void; onDeleteComment(form: DeleteComment): void; diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx index 4cd3e18f..f84f867b 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -6,7 +6,6 @@ import { EditPost, GetSiteMetadataResponse, Language, - PostResponse, PostView, SearchResponse, } from "lemmy-js-client"; @@ -55,8 +54,8 @@ interface PostFormProps { siteLanguages: number[]; params?: PostFormParams; onCancel?(): void; - onCreate?(form: CreatePost): Promise>; - onEdit?(form: EditPost): Promise>; + onCreate?(form: CreatePost): void; + onEdit?(form: EditPost): void; enableNsfw?: boolean; enableDownvotes?: boolean; selectedCommunityChoice?: Choice; @@ -486,7 +485,7 @@ export class PostForm extends Component { } } - async handlePostSubmit(i: PostForm, event: any) { + handlePostSubmit(i: PostForm, event: any) { event.preventDefault(); // Coerce empty url string to undefined if ((i.state.form.url ?? "blank") === "") { @@ -498,7 +497,7 @@ export class PostForm extends Component { let pForm = i.state.form; let pv = i.props.post_view; if (pv) { - await i.props.onEdit?.({ + i.props.onEdit?.({ name: pForm.name, url: pForm.url, body: pForm.body, @@ -508,7 +507,7 @@ export class PostForm extends Component { auth, }); } else if (pForm.name && pForm.community_id) { - await i.props.onCreate?.({ + i.props.onCreate?.({ name: pForm.name, community_id: pForm.community_id, url: pForm.url, From f7cb97eef42ea838be895ae0a474f9fb4581324f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 6 Jun 2023 09:15:45 -0400 Subject: [PATCH 2/3] Upgrading lemmy-js-client. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 89cbc8dc..0638d266 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "inferno-server": "^8.1.1", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", - "lemmy-js-client": "0.17.2-rc.23", + "lemmy-js-client": "0.17.2-rc.24", "lodash": "^4.17.21", "markdown-it": "^13.0.1", "markdown-it-container": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 114861a4..94301d22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5341,10 +5341,10 @@ leac@^0.6.0: resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912" integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg== -lemmy-js-client@0.17.2-rc.23: - version "0.17.2-rc.23" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.23.tgz#7e3e2d2ba82b721a9dc092e687874eebeb080637" - integrity sha512-MXUg2s9CZbH5+G53RvfM9M/UnPtH+LnnMc05sWRNVkKDnpl1nHudIrbRTqOOJNikTf1sJLxGvUOi8TTDJ3OSdQ== +lemmy-js-client@0.17.2-rc.24: + version "0.17.2-rc.24" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.24.tgz#3b09233a6d89286e559be2e840d81c0c549562ad" + integrity sha512-aSHz7UTcwnwnNd9poY8tEXP7RA9ieZm9MAfSljcbCNU5ds9CASXYNodmraUVJiqCmT4HWnj7IeVmBC9r7nTHnw== dependencies: cross-fetch "^3.1.5" form-data "^4.0.0" From f5cf816c39e2873a1abfb7a9ea17e31d24b9f0f6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 6 Jun 2023 09:16:04 -0400 Subject: [PATCH 3/3] Fixing verify email. --- src/shared/components/person/verify-email.tsx | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/shared/components/person/verify-email.tsx b/src/shared/components/person/verify-email.tsx index 18cd3d21..da6eb917 100644 --- a/src/shared/components/person/verify-email.tsx +++ b/src/shared/components/person/verify-email.tsx @@ -1,11 +1,5 @@ import { Component } from "inferno"; -import { - GetSiteResponse, - UserOperation, - VerifyEmailResponse, - wsJsonToRes, - wsUserOp, -} from "lemmy-js-client"; +import { GetSiteResponse, VerifyEmailResponse } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { HttpService, RequestState } from "../../services/HttpService"; import { setIsoData, toast } from "../../utils"; @@ -76,21 +70,4 @@ export class VerifyEmail extends Component { ); } - - parseMessage(msg: any) { - let op = wsUserOp(msg); - console.log(msg); - if (msg.error) { - toast(i18n.t(msg.error), "danger"); - this.setState(this.state); - this.props.history.push("/"); - return; - } else if (op == UserOperation.VerifyEmail) { - let data = wsJsonToRes(msg); - if (data) { - toast(i18n.t("email_verified")); - this.props.history.push("/login"); - } - } - } }