setIsoData,
showLocal,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import {
getPageFromString,
getQueryParams,
this.handleListingTypeChange = this.handleListingTypeChange.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { listCommunitiesResponse } = this.isoData.routeData;
this.state = {
updateCommunityBlock,
updatePersonBlock,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import {
getPageFromString,
getQueryParams,
this.handleFeaturePost = this.handleFeaturePost.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { communityRes, commentsRes, postsRes } = this.isoData.routeData;
this.state = {
setIsoData,
showLocal,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { capitalizeFirstLetter } from "@utils/helpers";
import { RouteDataResponse } from "@utils/types";
import classNames from "classnames";
this.handleCreateEmoji = this.handleCreateEmoji.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { bannedRes, instancesRes } = this.isoData.routeData;
this.state = {
showLocal,
updatePersonBlock,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import {
getPageFromString,
getQueryParams,
this.handleFeaturePost = this.handleFeaturePost.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { trendingCommunitiesRes, commentsRes, postsRes } =
this.isoData.routeData;
import { setIsoData } from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { RouteDataResponse } from "@utils/types";
import { Component } from "inferno";
import {
super(props, context);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
this.state = {
...this.state,
instancesRes: this.isoData.routeData.federatedInstancesResponse,
personToChoice,
setIsoData,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import {
debounce,
getIdFromString,
this.handleModChange = this.handleModChange.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { res, communityRes, modUserResponse, userResponse } =
this.isoData.routeData;
setIsoData,
updatePersonBlock,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { RouteDataResponse } from "@utils/types";
import { Component, linkEvent } from "inferno";
import {
this.handleEditMessage = this.handleEditMessage.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { mentionsRes, messagesRes, repliesRes } = this.isoData.routeData;
this.state = {
setIsoData,
updatePersonBlock,
} from "@utils/app";
-import {
- isBrowser,
- restoreScrollPosition,
- saveScrollPosition,
-} from "@utils/browser";
+import { restoreScrollPosition, saveScrollPosition } from "@utils/browser";
import {
capitalizeFirstLetter,
futureDaysToUnixTime,
this.handleFeaturePost = this.handleFeaturePost.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
this.state = {
...this.state,
personRes: this.isoData.routeData.personResponse,
myAuthRequired,
setIsoData,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { RouteDataResponse } from "@utils/types";
import { Component, linkEvent } from "inferno";
import {
this.handleApproveApplication = this.handleApproveApplication.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
this.state = {
...this.state,
appsRes: this.isoData.routeData.listRegistrationApplicationsResponse,
myAuthRequired,
setIsoData,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { amAdmin } from "@utils/roles";
import { RouteDataResponse } from "@utils/types";
import { Component, linkEvent } from "inferno";
this.handleResolvePrivateMessageReport.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { commentReportsRes, postReportsRes, messageReportsRes } =
this.isoData.routeData;
import { enableDownvotes, enableNsfw, myAuth, setIsoData } from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { getIdFromString, getQueryParams } from "@utils/helpers";
import type { QueryParams } from "@utils/types";
import { Choice, RouteDataResponse } from "@utils/types";
this.handleSelectedCommunityChange.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { communityResponse: communityRes, initialCommunitiesRes } =
this.isoData.routeData;
this.state = { ...this.state, commentSectionRef: createRef() };
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { commentsRes, postRes } = this.isoData.routeData;
this.state = {
import { getRecipientIdFromProps, myAuth, setIsoData } from "@utils/app";
-import { isBrowser } from "@utils/browser";
import { RouteDataResponse } from "@utils/types";
import { Component } from "inferno";
import {
this.handlePrivateMessageCreate.bind(this);
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
this.state = {
...this.state,
recipientRes: this.isoData.routeData.recipientDetailsResponse,
setIsoData,
showLocal,
} from "@utils/app";
-import {
- isBrowser,
- restoreScrollPosition,
- saveScrollPosition,
-} from "@utils/browser";
+import { restoreScrollPosition, saveScrollPosition } from "@utils/browser";
import {
capitalizeFirstLetter,
debounce,
};
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const {
communityResponse: communityRes,
creatorDetailsResponse: creatorDetailsRes,
+import { isBrowser } from "@utils/browser";
+
export class FirstLoadService {
#isFirstLoad: boolean;
static #instance: FirstLoadService;
}
static get isFirstLoad() {
- return this.#Instance.isFirstLoad;
+ return !isBrowser() || this.#Instance.isFirstLoad;
}
}