"inferno-server": "^8.1.1",
"isomorphic-cookie": "^1.2.4",
"jwt-decode": "^3.1.2",
- "lemmy-js-client": "0.17.2-rc.15",
+ "lemmy-js-client": "0.17.2-rc.17",
"lodash": "^4.17.21",
"markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0",
interface NavbarState {
expanded: boolean;
- unreadInboxCount: bigint;
- unreadReportCount: bigint;
- unreadApplicationCount: bigint;
+ unreadInboxCount: number;
+ unreadReportCount: number;
+ unreadApplicationCount: number;
showDropdown: boolean;
onSiteBanner?(url: string): any;
}
private unreadReportCountSub: Subscription;
private unreadApplicationCountSub: Subscription;
state: NavbarState = {
- unreadInboxCount: 0n,
- unreadReportCount: 0n,
- unreadApplicationCount: 0n,
+ unreadInboxCount: 0,
+ unreadReportCount: 0,
+ unreadApplicationCount: 0,
expanded: false,
showDropdown: false,
};
unreadReportCount:
data.post_reports +
data.comment_reports +
- (data.private_message_reports ?? 0n),
+ (data.private_message_reports ?? 0),
});
this.sendReportUnread();
} else if (op == UserOperation.GetUnreadRegistrationApplicationCount) {
data.recipient_ids.includes(mui.local_user_view.local_user.id)
) {
this.setState({
- unreadInboxCount: this.state.unreadInboxCount + 1n,
+ unreadInboxCount: this.state.unreadInboxCount + 1,
});
this.sendUnreadCount();
notifyComment(data.comment_view, this.context.router);
UserService.Instance.myUserInfo?.local_user_view.person.id
) {
this.setState({
- unreadInboxCount: this.state.unreadInboxCount + 1n,
+ unreadInboxCount: this.state.unreadInboxCount + 1,
});
this.sendUnreadCount();
notifyPrivateMessage(data.private_message_view, this.context.router);
showReportDialog: boolean;
reportReason?: string;
my_vote?: number;
- score: bigint;
- upvotes: bigint;
- downvotes: bigint;
+ score: number;
+ upvotes: number;
+ downvotes: number;
readLoading: boolean;
saveLoading: boolean;
}
>
{i18n.t("x_more_replies", {
count: node.comment_view.counts.child_count,
- formattedCount: numToSI(
- BigInt(node.comment_view.counts.child_count)
- ),
+ formattedCount: numToSI(node.comment_view.counts.child_count),
})}{" "}
➔
</button>
if (myVote == 1) {
this.setState({
- score: this.state.score - 1n,
- upvotes: this.state.upvotes - 1n,
+ score: this.state.score - 1,
+ upvotes: this.state.upvotes - 1,
});
} else if (myVote == -1) {
this.setState({
- downvotes: this.state.downvotes - 1n,
- upvotes: this.state.upvotes + 1n,
- score: this.state.score + 2n,
+ downvotes: this.state.downvotes - 1,
+ upvotes: this.state.upvotes + 1,
+ score: this.state.score + 2,
});
} else {
this.setState({
- score: this.state.score + 1n,
- upvotes: this.state.upvotes + 1n,
+ score: this.state.score + 1,
+ upvotes: this.state.upvotes + 1,
});
}
if (myVote == 1) {
this.setState({
- downvotes: this.state.downvotes + 1n,
- upvotes: this.state.upvotes - 1n,
- score: this.state.score - 2n,
+ downvotes: this.state.downvotes + 1,
+ upvotes: this.state.upvotes - 1,
+ score: this.state.score - 2,
});
} else if (myVote == -1) {
this.setState({
- downvotes: this.state.downvotes - 1n,
- score: this.state.score + 1n,
+ downvotes: this.state.downvotes - 1,
+ score: this.state.score + 1,
});
} else {
this.setState({
- downvotes: this.state.downvotes + 1n,
- score: this.state.score - 1n,
+ downvotes: this.state.downvotes + 1,
+ score: this.state.score - 1,
});
}
post_id: i.props.node.comment_view.post.id,
parent_id: i.props.node.comment_view.comment.id,
max_depth: commentTreeMaxDepth,
- limit: 999n, // TODO
+ limit: 999, // TODO
type_: "All",
saved_only: false,
auth: myAuth(false),
import { i18n } from "../../i18next";
interface PaginatorProps {
- page: bigint;
- onChange(val: bigint): any;
+ page: number;
+ onChange(val: number): any;
}
export class Paginator extends Component<PaginatorProps, any> {
<div className="my-2">
<button
className="btn btn-secondary mr-2"
- disabled={this.props.page == 1n}
+ disabled={this.props.page == 1}
onClick={linkEvent(this, this.handlePrev)}
>
{i18n.t("prev")}
}
handlePrev(i: Paginator) {
- i.props.onChange(i.props.page - 1n);
+ i.props.onChange(i.props.page - 1);
}
handleNext(i: Paginator) {
- i.props.onChange(i.props.page + 1n);
+ i.props.onChange(i.props.page + 1);
}
}
import { Paginator } from "../common/paginator";
import { CommunityLink } from "./community-link";
-const communityLimit = 50n;
+const communityLimit = 50;
interface CommunitiesState {
listCommunitiesResponse?: ListCommunitiesResponse;
interface CommunitiesProps {
listingType: ListingType;
- page: bigint;
+ page: number;
}
function getCommunitiesQueryParams() {
refetch();
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
}
handleListingTypeChange(val: ListingType) {
this.updateUrl({
listingType: val,
- page: 1n,
+ page: 1,
});
}
interface CommunityProps {
dataType: DataType;
sort: SortType;
- page: bigint;
+ page: number;
}
function getCommunityQueryParams() {
);
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
window.scrollTo(0, 0);
}
handleSortChange(sort: SortType) {
- this.updateUrl({ sort, page: 1n });
+ this.updateUrl({ sort, page: 1 });
window.scrollTo(0, 0);
}
handleDataTypeChange(dataType: DataType) {
- this.updateUrl({ dataType, page: 1n });
+ this.updateUrl({ dataType, page: 1 });
window.scrollTo(0, 0);
}
.show_new_post_notifs;
// Only push these if you're on the first page, you pass the nsfw check, and it isn't blocked
- if (
- page === 1n &&
- nsfwCheck(post_view) &&
- !isPostBlocked(post_view)
- ) {
+ if (page === 1 && nsfwCheck(post_view) && !isPostBlocked(post_view)) {
this.state.posts.unshift(post_view);
if (showPostNotifs) {
notifyPost(post_view, this.context.router);
<li className="list-inline-item badge badge-secondary">
{i18n.t("number_online", {
count: this.props.online,
- formattedCount: numToSI(BigInt(this.props.online)),
+ formattedCount: numToSI(this.props.online),
})}
</li>
<li
siteRes: GetSiteResponse;
customEmojis: CustomEmojiViewForm[];
loading: boolean;
- page: bigint;
+ page: number;
}
interface CustomEmojiViewForm {
alt_text: string;
keywords: string;
changed: boolean;
- page: bigint;
+ page: number;
}
export class EmojiForm extends Component<any, EmojiFormState> {
alt_text: x.custom_emoji.alt_text,
keywords: x.keywords.map(x => x.keyword).join(" "),
changed: false,
- page: BigInt(1 + Math.floor(index / this.itemsPerPage)),
+ page: 1 + Math.floor(index / this.itemsPerPage),
})),
- page: 1n,
+ page: 1,
};
state: EmojiFormState;
private scrollRef: any = {};
<tbody>
{this.state.customEmojis
.slice(
- Number((this.state.page - 1n) * BigInt(this.itemsPerPage)),
+ Number((this.state.page - 1) * this.itemsPerPage),
Number(
- (this.state.page - 1n) * BigInt(this.itemsPerPage) +
- BigInt(this.itemsPerPage)
+ (this.state.page - 1) * this.itemsPerPage +
+ this.itemsPerPage
)
)
.map((cv, index) => (
else return i18n.t("custom_emoji_save_validation");
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.setState({ page: page });
}
) {
let custom_emojis = [...props.form.state.customEmojis];
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
let item = {
- ...props.form.state.customEmojis[Number(pagedIndex)],
+ ...props.form.state.customEmojis[pagedIndex],
category: event.target.value,
changed: true,
};
) {
let custom_emojis = [...props.form.state.customEmojis];
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
let item = {
- ...props.form.state.customEmojis[Number(pagedIndex)],
+ ...props.form.state.customEmojis[pagedIndex],
shortcode: event.target.value,
changed: true,
};
) {
let custom_emojis = [...props.form.state.customEmojis];
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
let item = {
- ...props.form.state.customEmojis[Number(pagedIndex)],
+ ...props.form.state.customEmojis[pagedIndex],
image_url: props.overrideValue ?? event.target.value,
changed: true,
};
) {
let custom_emojis = [...props.form.state.customEmojis];
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
let item = {
- ...props.form.state.customEmojis[Number(pagedIndex)],
+ ...props.form.state.customEmojis[pagedIndex],
alt_text: event.target.value,
changed: true,
};
) {
let custom_emojis = [...props.form.state.customEmojis];
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
let item = {
- ...props.form.state.customEmojis[Number(pagedIndex)],
+ ...props.form.state.customEmojis[pagedIndex],
keywords: event.target.value,
changed: true,
};
cv: CustomEmojiViewForm;
}) {
let pagedIndex =
- (props.form.state.page - 1n) * BigInt(props.form.itemsPerPage) +
- BigInt(props.index);
+ (props.form.state.page - 1) * props.form.itemsPerPage + props.index;
if (props.cv.id != 0) {
const deleteForm: DeleteCustomEmoji = {
id: props.cv.id,
handleAddEmojiClick(form: EmojiForm, event: any) {
event.preventDefault();
let custom_emojis = [...form.state.customEmojis];
- const page = BigInt(
- 1 + Math.floor(form.state.customEmojis.length / form.itemsPerPage)
- );
+ const page =
+ 1 + Math.floor(form.state.customEmojis.length / form.itemsPerPage);
let item: CustomEmojiViewForm = {
id: 0,
shortcode: "",
listingType: ListingType;
dataType: DataType;
sort: SortType;
- page: bigint;
+ page: number;
}
function getDataTypeFromQuery(type?: string): DataType {
const type_ = getListingTypeFromQuery(listingType);
const sort = getSortTypeFromQuery(urlSort);
- const page = urlPage ? BigInt(urlPage) : 1n;
+ const page = urlPage ? Number(urlPage) : 1;
const promises: Promise<any>[] = [];
i.setState({ subscribedCollapsed: !i.state.subscribedCollapsed });
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
window.scrollTo(0, 0);
}
handleSortChange(val: SortType) {
- this.updateUrl({ sort: val, page: 1n });
+ this.updateUrl({ sort: val, page: 1 });
window.scrollTo(0, 0);
}
handleListingTypeChange(val: ListingType) {
- this.updateUrl({ listingType: val, page: 1n });
+ this.updateUrl({ listingType: val, page: 1 });
window.scrollTo(0, 0);
}
handleDataTypeChange(val: DataType) {
- this.updateUrl({ dataType: val, page: 1n });
+ this.updateUrl({ dataType: val, page: 1 });
window.scrollTo(0, 0);
}
const { post_view } = wsJsonToRes<PostResponse>(msg);
// Only push these if you're on the first page, you pass the nsfw check, and it isn't blocked
- if (
- page === 1n &&
- nsfwCheck(post_view) &&
- !isPostBlocked(post_view)
- ) {
+ if (page === 1 && nsfwCheck(post_view) && !isPostBlocked(post_view)) {
const mui = UserService.Instance.myUserInfo;
const showPostNotifs =
mui?.local_user_view.local_user.show_new_post_notifs;
<li className="list-inline-item badge badge-secondary">
{i18n.t("number_online", {
count: online,
- formattedCount: numToSI(BigInt(online)),
+ formattedCount: numToSI(online),
})}
</li>
<li
}
interface ModlogProps {
- page: bigint;
+ page: number;
userId?: number | null;
modId?: number | null;
actionType: ModlogActionType;
handleFilterActionChange(i: Modlog, event: any) {
i.updateUrl({
actionType: event.target.value as ModlogActionType,
- page: 1n,
+ page: 1,
});
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
}
handleUserChange(option: Choice) {
- this.updateUrl({ userId: getIdFromString(option.value) ?? null, page: 1n });
+ this.updateUrl({ userId: getIdFromString(option.value) ?? null, page: 1 });
}
handleModChange(option: Choice) {
- this.updateUrl({ modId: getIdFromString(option.value) ?? null, page: 1n });
+ this.updateUrl({ modId: getIdFromString(option.value) ?? null, page: 1 });
}
handleSearchUsers = debounce(async (text: string) => {
messages: PrivateMessageView[];
combined: ReplyType[];
sort: CommentSortType;
- page: bigint;
+ page: number;
siteRes: GetSiteResponse;
loading: boolean;
}
messages: [],
combined: [],
sort: "New",
- page: 1n,
+ page: 1,
siteRes: this.isoData.site_res,
loading: true,
};
);
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.setState({ page });
this.refetch();
}
handleUnreadOrAllChange(i: Inbox, event: any) {
- i.setState({ unreadOrAll: Number(event.target.value), page: 1n });
+ i.setState({ unreadOrAll: Number(event.target.value), page: 1 });
i.refetch();
}
handleMessageTypeChange(i: Inbox, event: any) {
- i.setState({ messageType: Number(event.target.value), page: 1n });
+ i.setState({ messageType: Number(event.target.value), page: 1 });
i.refetch();
}
let repliesForm: GetReplies = {
sort: "New",
unread_only: true,
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth,
};
let personMentionsForm: GetPersonMentions = {
sort,
unread_only: true,
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth,
};
let privateMessagesForm: GetPrivateMessages = {
unread_only: true,
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth,
};
}
handleSortChange(val: CommentSortType) {
- this.setState({ sort: val, page: 1n });
+ this.setState({ sort: val, page: 1 });
this.refetch();
}
);
i.setState({ replies: [], mentions: [], messages: [] });
i.setState({ combined: i.buildCombined() });
- UserService.Instance.unreadInboxCountSub.next(0n);
+ UserService.Instance.unreadInboxCountSub.next(0);
window.scrollTo(0, 0);
i.setState(i.state);
}
sendUnreadCount(read: boolean) {
let urcs = UserService.Instance.unreadInboxCountSub;
if (read) {
- urcs.next(urcs.getValue() - 1n);
+ urcs.next(urcs.getValue() - 1);
} else {
- urcs.next(urcs.getValue() + 1n);
+ urcs.next(urcs.getValue() + 1);
}
}
admins: PersonView[];
allLanguages: Language[];
siteLanguages: number[];
- page: bigint;
- limit: bigint;
+ page: number;
+ limit: number;
sort: SortType;
enableDownvotes: boolean;
enableNsfw: boolean;
view: PersonDetailsView;
- onPageChange(page: bigint): bigint | any;
+ onPageChange(page: number): number | any;
}
enum ItemEnum {
type_: ItemEnum;
view: CommentView | PostView;
published: string;
- score: bigint;
+ score: number;
};
export class PersonDetails extends Component<PersonDetailsProps, any> {
);
}
- handlePageChange(val: bigint) {
+ handlePageChange(val: number) {
this.props.onPageChange(val);
}
}
interface ProfileProps {
view: PersonDetailsView;
sort: SortType;
- page: bigint;
+ page: number;
}
function getProfileQueryParams() {
this.fetchUserData();
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
}
handleSortChange(sort: SortType) {
- this.updateUrl({ sort, page: 1n });
+ this.updateUrl({ sort, page: 1 });
}
handleViewChange(i: Profile, event: any) {
i.updateUrl({
view: PersonDetailsView[event.target.value],
- page: 1n,
+ page: 1,
});
}
listRegistrationApplicationsResponse?: ListRegistrationApplicationsResponse;
siteRes: GetSiteResponse;
unreadOrAll: UnreadOrAll;
- page: bigint;
+ page: number;
loading: boolean;
}
state: RegistrationApplicationsState = {
siteRes: this.isoData.site_res,
unreadOrAll: UnreadOrAll.Unread,
- page: 1n,
+ page: 1,
loading: true,
};
}
handleUnreadOrAllChange(i: RegistrationApplications, event: any) {
- i.setState({ unreadOrAll: Number(event.target.value), page: 1n });
+ i.setState({ unreadOrAll: Number(event.target.value), page: 1 });
i.refetch();
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.setState({ page });
this.refetch();
}
if (auth) {
let form: ListRegistrationApplications = {
unread_only: true,
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth,
};
);
let uacs = UserService.Instance.unreadApplicationCountSub;
// Minor bug, where if the application switches from deny to approve, the count will still go down
- uacs.next(uacs.getValue() - 1n);
+ uacs.next(uacs.getValue() - 1);
this.setState(this.state);
}
}
messageType: MessageType;
combined: ItemType[];
siteRes: GetSiteResponse;
- page: bigint;
+ page: number;
loading: boolean;
}
unreadOrAll: UnreadOrAll.Unread,
messageType: MessageType.All,
combined: [],
- page: 1n,
+ page: 1,
siteRes: this.isoData.site_res,
loading: true,
};
);
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.setState({ page });
this.refetch();
}
handleUnreadOrAllChange(i: Reports, event: any) {
- i.setState({ unreadOrAll: Number(event.target.value), page: 1n });
+ i.setState({ unreadOrAll: Number(event.target.value), page: 1 });
i.refetch();
}
handleMessageTypeChange(i: Reports, event: any) {
- i.setState({ messageType: Number(event.target.value), page: 1n });
+ i.setState({ messageType: Number(event.target.value), page: 1 });
i.refetch();
}
let promises: Promise<any>[] = [];
let unresolved_only = true;
- let page = 1n;
+ let page = 1;
let limit = fetchLimit;
let auth = req.auth;
);
let urcs = UserService.Instance.unreadReportCountSub;
if (data.post_report_view.post_report.resolved) {
- urcs.next(urcs.getValue() - 1n);
+ urcs.next(urcs.getValue() - 1);
} else {
- urcs.next(urcs.getValue() + 1n);
+ urcs.next(urcs.getValue() + 1);
}
this.setState(this.state);
} else if (op == UserOperation.ResolveCommentReport) {
);
let urcs = UserService.Instance.unreadReportCountSub;
if (data.comment_report_view.comment_report.resolved) {
- urcs.next(urcs.getValue() - 1n);
+ urcs.next(urcs.getValue() - 1);
} else {
- urcs.next(urcs.getValue() + 1n);
+ urcs.next(urcs.getValue() + 1);
}
this.setState(this.state);
} else if (op == UserOperation.ResolvePrivateMessageReport) {
);
let urcs = UserService.Instance.unreadReportCountSub;
if (data.private_message_report_view.private_message_report.resolved) {
- urcs.next(urcs.getValue() - 1n);
+ urcs.next(urcs.getValue() - 1);
} else {
- urcs.next(urcs.getValue() + 1n);
+ urcs.next(urcs.getValue() + 1);
}
this.setState(this.state);
}
type_: "Url",
sort: "TopAll",
listing_type: "All",
- page: 1n,
+ page: 1,
limit: trendingFetchLimit,
auth: myAuth(false),
};
sort: "TopAll",
listing_type: "All",
community_id: this.state.form.community_id,
- page: 1n,
+ page: 1,
limit: trendingFetchLimit,
auth: myAuth(false),
};
showReportDialog: boolean;
reportReason?: string;
my_vote?: number;
- score: bigint;
- upvotes: bigint;
- downvotes: bigint;
+ score: number;
+ upvotes: number;
+ downvotes: number;
}
interface PostListingProps {
);
}
- get unreadCount(): bigint | undefined {
+ get unreadCount(): number | undefined {
let pv = this.props.post_view;
- return pv.unread_comments == pv.counts.comments || pv.unread_comments == 0n
+ return pv.unread_comments == pv.counts.comments || pv.unread_comments == 0
? undefined
: pv.unread_comments;
}
{showScores() && (
<span
className={classNames("ml-2", {
- invisible: this.state.downvotes === 0n,
+ invisible: this.state.downvotes === 0,
})}
>
{numToSI(this.state.downvotes)}
if (myVote == 1) {
this.setState({
- score: this.state.score - 1n,
- upvotes: this.state.upvotes - 1n,
+ score: this.state.score - 1,
+ upvotes: this.state.upvotes - 1,
});
} else if (myVote == -1) {
this.setState({
- score: this.state.score + 2n,
- upvotes: this.state.upvotes + 1n,
- downvotes: this.state.downvotes - 1n,
+ score: this.state.score + 2,
+ upvotes: this.state.upvotes + 1,
+ downvotes: this.state.downvotes - 1,
});
} else {
this.setState({
- score: this.state.score + 1n,
- upvotes: this.state.upvotes + 1n,
+ score: this.state.score + 1,
+ upvotes: this.state.upvotes + 1,
});
}
if (myVote == 1) {
this.setState({
- score: this.state.score - 2n,
- upvotes: this.state.upvotes - 1n,
- downvotes: this.state.downvotes + 1n,
+ score: this.state.score - 2,
+ upvotes: this.state.upvotes - 1,
+ downvotes: this.state.downvotes + 1,
});
} else if (myVote == -1) {
this.setState({
- score: this.state.score + 1n,
- downvotes: this.state.downvotes - 1n,
+ score: this.state.score + 1,
+ downvotes: this.state.downvotes - 1,
});
} else {
this.setState({
- score: this.state.score - 1n,
- downvotes: this.state.downvotes + 1n,
+ score: this.state.score - 1,
+ downvotes: this.state.downvotes + 1,
});
}
read: false,
creator_blocked: false,
my_vote: r.my_vote,
- unread_comments: 0n,
+ unread_comments: 0,
};
return (
type_: "Url",
sort: "TopAll",
listing_type: "All",
- page: 1n,
+ page: 1,
limit: trendingFetchLimit,
auth: myAuth(false),
};
listingType: ListingType;
communityId?: number | null;
creatorId?: number | null;
- page: bigint;
+ page: number;
}
type FilterType = "creator" | "community";
function getListing(
listing: JSX.ElementClass,
- count: bigint,
+ count: number,
translationKey: "number_of_comments" | "number_of_subscribers"
) {
return (
});
handleSortChange(sort: SortType) {
- this.updateUrl({ sort, page: 1n });
+ this.updateUrl({ sort, page: 1 });
}
handleTypeChange(i: Search, event: any) {
i.updateUrl({
type,
- page: 1n,
+ page: 1,
});
}
- handlePageChange(page: bigint) {
+ handlePageChange(page: number) {
this.updateUrl({ page });
}
handleListingTypeChange(listingType: ListingType) {
this.updateUrl({
listingType,
- page: 1n,
+ page: 1,
});
}
handleCommunityFilterChange({ value }: Choice) {
this.updateUrl({
communityId: getIdFromString(value) ?? null,
- page: 1n,
+ page: 1,
});
}
handleCreatorFilterChange({ value }: Choice) {
this.updateUrl({
creatorId: getIdFromString(value) ?? null,
- page: 1n,
+ page: 1,
});
}
i.updateUrl({
q: i.state.searchText,
- page: 1n,
+ page: 1,
});
}
private static _instance: UserService;
public myUserInfo?: MyUserInfo;
public jwtInfo?: JwtInfo;
- public unreadInboxCountSub: BehaviorSubject<bigint> =
- new BehaviorSubject<bigint>(0n);
- public unreadReportCountSub: BehaviorSubject<bigint> =
- new BehaviorSubject<bigint>(0n);
- public unreadApplicationCountSub: BehaviorSubject<bigint> =
- new BehaviorSubject<bigint>(0n);
+ public unreadInboxCountSub: BehaviorSubject<number> =
+ new BehaviorSubject<number>(0);
+ public unreadReportCountSub: BehaviorSubject<number> =
+ new BehaviorSubject<number>(0);
+ public unreadApplicationCountSub: BehaviorSubject<number> =
+ new BehaviorSubject<number>(0);
private constructor() {
this.setJwtInfo();
export const elementUrl = "https://element.io";
export const postRefetchSeconds: number = 60 * 1000;
-export const fetchLimit = 40n;
-export const trendingFetchLimit = 6n;
+export const fetchLimit = 40;
+export const trendingFetchLimit = 6;
export const mentionDropdownFetchLimit = 10;
export const commentTreeMaxDepth = 8;
export const markdownFieldCharacterLimit = 50000;
-export const maxUploadImages = 20n;
+export const maxUploadImages = 20;
export const concurrentImageUpload = 4;
export const relTags = "noopener nofollow";
return id && id !== "0" && !Number.isNaN(Number(id)) ? Number(id) : undefined;
}
-export function getPageFromString(page?: string): bigint {
- return page && !Number.isNaN(Number(page)) ? BigInt(page) : BigInt(1);
+export function getPageFromString(page?: string): number {
+ return page && !Number.isNaN(Number(page)) ? Number(page) : 1;
}
export function randomStr(
return hotRank(post_view.counts.score, post_view.post.published);
}
-export function hotRank(score: bigint, timeStr: string): number {
+export function hotRank(score: number, timeStr: string): number {
// Rank = ScaleFactor * sign(Score) * log(1 + abs(Score)) / (Time + 2)^Gravity
let date: Date = new Date(timeStr + "Z"); // Add Z to convert from UTC date
let now: Date = new Date();
let hoursElapsed: number = (now.getTime() - date.getTime()) / 36e5;
let rank =
- (10000 * Math.log10(Math.max(1, Number(3n + score)))) /
+ (10000 * Math.log10(Math.max(1, 3 + Number(score)))) /
Math.pow(hoursElapsed + 2, 1.8);
// console.log(`Comment: ${comment.content}\nRank: ${rank}\nScore: ${comment.score}\nHours: ${hoursElapsed}`);
return { __html: md.renderInline(text) };
}
-export function getUnixTime(text?: string): bigint | undefined {
- return text ? BigInt(new Date(text).getTime() / 1000) : undefined;
+export function getUnixTime(text?: string): number | undefined {
+ return text ? new Date(text).getTime() / 1000 : undefined;
}
-export function futureDaysToUnixTime(days?: number): bigint | undefined {
+export function futureDaysToUnixTime(days?: number): number | undefined {
return days
- ? BigInt(
- Math.trunc(
- new Date(Date.now() + 1000 * 60 * 60 * 24 * days).getTime() / 1000
- )
+ ? Math.trunc(
+ new Date(Date.now() + 1000 * 60 * 60 * 24 * days).getTime() / 1000
)
: undefined;
}
type_: "Communities",
sort: "TopAll",
listing_type: "All",
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth: myAuth(false),
};
type_: "Users",
sort: "TopAll",
listing_type: "All",
- page: 1n,
+ page: 1,
limit: fetchLimit,
auth: myAuth(false),
};
compactDisplay: "short",
});
-export function numToSI(value: bigint): string {
+export function numToSI(value: number): string {
return SHORTNUM_SI_FORMAT.format(value);
}
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.15:
- version "0.17.2-rc.15"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.15.tgz#a3b10227913c4dc12fa7b69cdc777e429d030721"
- integrity sha512-hnHW/570mQGoGNdnUaNp20+KVkyUnosaFLmWxlZyyhL7fiSbcIXM+GXsjTCqmc1JEnqASc6MdMMpYuZaBKVQtQ==
+lemmy-js-client@0.17.2-rc.17:
+ version "0.17.2-rc.17"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.17.tgz#91a167c3b61db39fab2e977685a42a77aeae519a"
+ integrity sha512-DBzQjVRo89co7Wppl72/xlNdJfAnXrUE0UgWZxO3v2I8axK9JUD4XmodpRe33thpfPmsURQ1W7dOUX60rcQPQg==
dependencies:
cross-fetch "^3.1.5"
form-data "^4.0.0"