Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"inferno-router": "^9.0.10",
"inferno-server": "^9.0.7",
"jwt-decode": "^4.0.0",
"lemmy-js-client": "1.0.0-community-tag-update.0",
"lemmy-js-client": "1.0.0-rename-update-edit.2",
"markdown-it": "^14.1.0",
"markdown-it-bidi": "^0.2.0",
"markdown-it-container": "^4.0.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/shared/components/community/community-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
PersonView,
PurgeCommunity,
RemoveCommunity,
UpdateCommunityNotifications,
EditCommunityNotifications,
} from "lemmy-js-client";
import { mdToHtml } from "@utils/markdown";
import { HttpService, I18NextService } from "../../services";
Expand Down Expand Up @@ -48,7 +48,7 @@ interface SidebarProps {
onPurge(form: PurgeCommunity): void;
onFollow(form: FollowCommunity): void;
onBlock(form: BlockCommunity): void;
onUpdateNotifs(form: UpdateCommunityNotifications): void;
onEditNotifs(form: EditCommunityNotifications): void;
removeLoading: boolean;
purgeLoading: boolean;
followLoading: boolean;
Expand Down Expand Up @@ -492,7 +492,7 @@ function handleNotificationChange(
community_id: i.props.communityView.community.id,
mode: i.state.notifications,
};
i.props.onUpdateNotifs(form);
i.props.onEditNotifs(form);
}

function handleFollow(i: CommunitySidebar, follow: boolean) {
Expand Down
8 changes: 4 additions & 4 deletions src/shared/components/community/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
MyUserInfo,
MarkPostAsRead,
NotePerson,
UpdateCommunityNotifications,
EditCommunityNotifications,
LockComment,
PostListingMode,
PaginationCursor,
Expand Down Expand Up @@ -584,7 +584,7 @@ export class Community extends Component<CommunityRouteProps, State> {
myUserInfo={this.isoData.myUserInfo}
onFollow={form => handleFollow(this, form, myUserInfo)}
onBlock={form => handleBlockCommunity(this, form, myUserInfo)}
onUpdateNotifs={form => handleUpdateCommunityNotifs(form)}
onEditNotifs={form => handleEditCommunityNotifs(form)}
onRemove={form => handleRemoveCommunity(this, form)}
onPurge={form => handlePurgeCommunity(this, form)}
removeLoading={this.state.removeCommunityRes.state === "loading"}
Expand Down Expand Up @@ -964,8 +964,8 @@ async function handleBlockPerson(
}
}

async function handleUpdateCommunityNotifs(form: UpdateCommunityNotifications) {
const res = await HttpService.client.updateCommunityNotifications(form);
async function handleEditCommunityNotifs(form: EditCommunityNotifications) {
const res = await HttpService.client.editCommunityNotifications(form);
if (res.state === "success") {
toast(I18NextService.i18n.t("notifications_updated"));
}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/home/admin-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
ListCustomEmojisResponse,
LocalImageView,
Tagline,
UpdateTagline,
EditTagline,
PaginationCursor,
} from "lemmy-js-client";
import { InitialFetchRequest } from "@utils/types";
Expand Down Expand Up @@ -1035,7 +1035,7 @@ async function handleDeleteTagline(i: AdminSettings, form: DeleteTagline) {
i.setState({ loading: false });
}

async function handleEditTagline(i: AdminSettings, form: UpdateTagline) {
async function handleEditTagline(i: AdminSettings, form: EditTagline) {
i.setState({ loading: true });
const res = await HttpService.client.editTagline(form);

Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/home/tagline-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
DeleteTagline,
MyUserInfo,
Tagline,
UpdateTagline,
EditTagline,
} from "lemmy-js-client";
import { I18NextService } from "../../services";
import { MarkdownTextArea } from "../common/markdown-textarea";
Expand All @@ -15,7 +15,7 @@ interface TaglineFormProps {
tagline?: Tagline; // If a tagline is given, that means this is an edit
myUserInfo: MyUserInfo | undefined;
onCreate?(form: CreateTagline): void;
onEdit?(form: UpdateTagline): void;
onEdit?(form: EditTagline): void;
onDelete?(form: DeleteTagline): void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
CreateMultiCommunity,
MultiCommunityView,
MyUserInfo,
UpdateMultiCommunity,
EditMultiCommunity,
} from "lemmy-js-client";
import { I18NextService } from "../../services";
import { Icon, Spinner } from "../common/icon";
Expand All @@ -16,7 +16,7 @@ import { validActorRegexPattern } from "@utils/config";
interface Props {
multiCommunityView?: MultiCommunityView; // If a multi-community is given, that means this is an edit
onCreate?(form: CreateMultiCommunity): void;
onEdit?(form: UpdateMultiCommunity): void;
onEdit?(form: EditMultiCommunity): void;
onDelete?(deleted: boolean): void;
createOrEditLoading?: boolean;
deleteLoading?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
LemmyHttp,
MultiCommunityId,
MultiCommunityResponse,
UpdateMultiCommunity,
EditMultiCommunity,
} from "lemmy-js-client";
import { InitialFetchRequest } from "@utils/types";
import { FirstLoadService, I18NextService } from "../../services";
Expand Down Expand Up @@ -230,13 +230,13 @@ async function handleDeleteMultiCommunity(
deleted: boolean,
) {
if (i.state.multiRes.state === "success") {
const form: UpdateMultiCommunity = {
const form: EditMultiCommunity = {
id: i.state.multiRes.data.multi_community_view.multi.id,
deleted,
};
i.setState({ deleteRes: LOADING_REQUEST });
i.setState({
deleteRes: await HttpService.client.updateMultiCommunity(form),
deleteRes: await HttpService.client.editMultiCommunity(form),
});

if (i.state.deleteRes.state === "success") {
Expand All @@ -252,12 +252,12 @@ async function handleDeleteMultiCommunity(

async function handleEditMultiCommunity(
i: MultiCommunitySettings,
form: UpdateMultiCommunity,
form: EditMultiCommunity,
) {
i.setState({ editRes: LOADING_REQUEST });

i.setState({
editRes: await HttpService.client.updateMultiCommunity(form),
editRes: await HttpService.client.editMultiCommunity(form),
});

if (i.state.editRes.state === "success") {
Expand Down
12 changes: 6 additions & 6 deletions src/shared/components/person/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
PostSortType,
SaveUserSettings,
SuccessResponse,
UpdateTotpResponse,
EditTotpResponse,
VoteShow,
InstanceId,
PersonId,
Expand Down Expand Up @@ -98,7 +98,7 @@ interface SettingsState {
deleteAccountRes: RequestState<SuccessResponse>;
instancesRes: RequestState<PagedResponse<FederatedInstanceView>>;
generateTotpRes: RequestState<GenerateTotpSecretResponse>;
updateTotpRes: RequestState<UpdateTotpResponse>;
editTotpRes: RequestState<EditTotpResponse>;
// TODO redo these forms
saveUserSettingsForm: SaveUserSettings;
changePasswordForm: {
Expand Down Expand Up @@ -205,7 +205,7 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
searchInstanceOptions: [],
isIsomorphic: false,
generateTotpRes: EMPTY_REQUEST,
updateTotpRes: EMPTY_REQUEST,
editTotpRes: EMPTY_REQUEST,
show2faModal: false,
importSettingsRes: EMPTY_REQUEST,
exportSettingsRes: EMPTY_REQUEST,
Expand Down Expand Up @@ -1516,14 +1516,14 @@ async function handleToggle2fa(
enabled: boolean,
myUserInfo: MyUserInfo | undefined,
) {
i.setState({ updateTotpRes: LOADING_REQUEST });
i.setState({ editTotpRes: LOADING_REQUEST });

const updateTotpRes = await HttpService.client.updateTotp({
const updateTotpRes = await HttpService.client.editTotp({
enabled,
totp_token: totp,
});

i.setState({ updateTotpRes });
i.setState({ editTotpRes: updateTotpRes });

const successful = updateTotpRes.state === "success";
if (successful && myUserInfo) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/post/create-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export class CreatePost extends Component<
hideButtons
onFollow={() => {}}
onBlock={() => {}}
onUpdateNotifs={() => {}}
onEditNotifs={() => {}}
onRemove={() => {}}
onPurge={() => {}}
removeLoading={false}
Expand Down
10 changes: 5 additions & 5 deletions src/shared/components/post/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import {
SavePost,
SuccessResponse,
TransferCommunity,
UpdateCommunityNotifications,
EditCommunityNotifications,
CommentSlimView,
PersonId,
Community,
Expand Down Expand Up @@ -909,7 +909,7 @@ export class Post extends Component<PostRouteProps, PostState> {
myUserInfo={this.isoData.myUserInfo}
onFollow={form => handleFollow(this, form, myUserInfo)}
onBlock={form => handleBlockCommunity(this, form, myUserInfo)}
onUpdateNotifs={form => handleUpdateCommunityNotifs(form)}
onEditNotifs={form => handleEditCommunityNotifs(form)}
onRemove={form => handleModRemoveCommunity(this, form)}
onPurge={form => handlePurgeCommunity(this, form)}
removeLoading={this.state.removeCommunityRes.state === "loading"}
Expand Down Expand Up @@ -1323,8 +1323,8 @@ async function handleModRemoveCommunity(i: Post, form: RemoveCommunity) {
i.updateCommunity(removeCommunityRes);
}

async function handleUpdateCommunityNotifs(form: UpdateCommunityNotifications) {
const res = await HttpService.client.updateCommunityNotifications(form);
async function handleEditCommunityNotifs(form: EditCommunityNotifications) {
const res = await HttpService.client.editCommunityNotifications(form);
if (res.state === "success") {
toast(I18NextService.i18n.t("notifications_updated"));
}
Expand Down Expand Up @@ -1647,7 +1647,7 @@ async function handleNotificationChange(i: Post, val: PostNotificationsMode) {
mode: val,
};
i.setState({ notifications: form.mode });
const res = await HttpService.client.updatePostNotifications(form);
const res = await HttpService.client.editPostNotifications(form);
if (res.state === "success") {
toast(I18NextService.i18n.t("notifications_updated"));
}
Expand Down