mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: org name changed from bitsocialhq to bitsocialnet
This commit is contained in:
@@ -23,12 +23,12 @@ const testState = vi.hoisted(() => ({
|
||||
subplebbitSnapshot: undefined as unknown,
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
useAccount: () => testState.account,
|
||||
useAccountSubplebbits: () => ({ accountSubplebbits: testState.accountSubplebbits }),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks/dist/lib/utils', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks/dist/lib/utils', () => ({
|
||||
flattenCommentsPages: () => testState.flattenedReplies,
|
||||
}));
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const testState = vi.hoisted(() => ({
|
||||
xhrResponses: new Map<string, { response?: ArrayBuffer; status: number; statusText: string }>(),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks/dist/lib/localforage-lru/index.js', () => ({
|
||||
default: {
|
||||
createInstance: () => ({
|
||||
getItem: testState.cacheGetItemMock,
|
||||
|
||||
@@ -19,14 +19,14 @@ const testState = vi.hoisted(() => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
useFeed: (options: Record<string, unknown> | undefined) => {
|
||||
testState.preloadOptions = options;
|
||||
return { feed: testState.preloadFeed };
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks/dist/stores/feeds', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks/dist/stores/feeds', () => ({
|
||||
default: (selector: (state: { feedsOptions: Record<string, unknown>; loadedFeeds: Record<string, unknown> }) => unknown) =>
|
||||
selector({
|
||||
feedsOptions: testState.feedsOptions,
|
||||
|
||||
@@ -16,7 +16,7 @@ const testState = vi.hoisted(() => ({
|
||||
publishCommentMock: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
usePublishComment: (options: Record<string, any>) => {
|
||||
testState.lastPublishOptions = options;
|
||||
return {
|
||||
|
||||
@@ -17,7 +17,7 @@ const testState = vi.hoisted(() => ({
|
||||
publishCommentMock: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
usePublishComment: (options: Record<string, any>) => {
|
||||
testState.lastPublishOptions = options;
|
||||
return {
|
||||
|
||||
@@ -19,7 +19,7 @@ const testState = vi.hoisted(() => ({
|
||||
subplebbitsStates: {} as Record<string, { clientUrls: string[]; subplebbitAddresses: string[] }>,
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
useClientsStates: () => ({
|
||||
states: testState.clientsStates,
|
||||
}),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccountSubplebbits } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useAccountSubplebbits } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
|
||||
export const useAccountSubplebbitAddresses = (): string[] => {
|
||||
const { accountSubplebbits } = useAccountSubplebbits({ onlyIfCached: true });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccountSubplebbits } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useAccountSubplebbits } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { DirectoryCommunity } from './use-directories';
|
||||
|
||||
export const useAccountSubplebbitsWithMetadata = (): DirectoryCommunity[] => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useAccount } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { useSubplebbitField } from './use-stable-subplebbit';
|
||||
|
||||
interface AuthorPrivilegesProps {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccountComments, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useAccountComments, Subplebbit } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
const useCatalogFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subplebbit: Subplebbit) => {
|
||||
const { address } = subplebbit || {};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { flattenCommentsPages } from '@bitsocialhq/bitsocial-react-hooks/dist/lib/utils';
|
||||
import { Comment } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { flattenCommentsPages } from '@bitsocialnet/bitsocial-react-hooks/dist/lib/utils';
|
||||
|
||||
const useCountLinksInReplies = (comment: Comment, firstXReplies?: number) => {
|
||||
let linkCount = 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ interface DirectoriesState {
|
||||
error: Error | null;
|
||||
}
|
||||
|
||||
const GITHUB_URL = 'https://raw.githubusercontent.com/bitsocialhq/lists/master/5chan-directories.json';
|
||||
const GITHUB_URL = 'https://raw.githubusercontent.com/bitsocialnet/lists/master/5chan-directories.json';
|
||||
const LOCALSTORAGE_KEY = '5chan-directories-cache';
|
||||
const LOCALSTORAGE_TIMESTAMP_KEY = '5chan-directories-cache-timestamp';
|
||||
const CACHE_MAX_AGE_MS = 60 * 60 * 1000; // 1 hour
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialnet/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
|
||||
const gifFrameDb = localForageLru.createInstance({ name: '5chanGifFrames', size: 500 });
|
||||
const failedUrls = new Set<string>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { create } from 'zustand';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialnet/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
|
||||
interface HideStoreState {
|
||||
hiddenCids: { [key: string]: boolean };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useEffect } from 'react';
|
||||
import { Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Subplebbit } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { getFormattedTimeAgo } from '../lib/utils/time-utils';
|
||||
import useSubplebbitOfflineStore from '../stores/use-subplebbit-offline-store';
|
||||
import useSubplebbitsLoadingStartTimestamps from '../stores/use-subplebbits-loading-start-timestamps-store';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { Comment, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Comment, Subplebbit } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { getCommentMediaInfo, getHasThumbnail } from '../lib/utils/media-utils';
|
||||
import useSubplebbitsLoadingStartTimestamps from '../stores/use-subplebbits-loading-start-timestamps-store';
|
||||
import { useCurrentTime } from './use-current-time';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useFeed } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useFeedsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/feeds';
|
||||
import { useFeed } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import useFeedsStore from '@bitsocialnet/bitsocial-react-hooks/dist/stores/feeds';
|
||||
import { useDirectoryByAddress } from './use-directories';
|
||||
import { useBoardFeedPageSize } from './use-board-feed-page-size';
|
||||
import { findPostPageInFeed, findPostPageInLoadedBoardFeeds, type FeedsOptionsLike, type LoadedFeedsLike } from '../lib/utils/post-page-resolution';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Comment, usePublishComment } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import usePublishPostStore from '../stores/use-publish-post-store';
|
||||
import useChallengesStore from '../stores/use-challenges-store';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Comment, usePublishComment } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import usePublishReplyStore from '../stores/use-publish-reply-store';
|
||||
import usePostNumberStore from '../stores/use-post-number-store';
|
||||
import { getQuotedCidsFromContent, mergeQuotedCids } from '../lib/utils/reply-quote-utils';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Comment } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { QUOTE_NUMBER_REGEX } from '../lib/utils/url-utils';
|
||||
import usePostNumberStore from '../stores/use-post-number-store';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
import useSubplebbitsStore from '@bitsocialnet/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
|
||||
/**
|
||||
* Shallow compare two objects by keys and values.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useClientsStates, useSubplebbit, useSubplebbitsStates } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useClientsStates, useSubplebbit, useSubplebbitsStates } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
interface CommentOrSubplebbit {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useSubplebbitStats } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useSubplebbitStats } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import { create } from 'zustand';
|
||||
|
||||
type SubplebbitsStatsState = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isAllView, isSubscriptionsView, isModView } from '../lib/utils/view-uti
|
||||
import useThemeStore from '../stores/use-theme-store';
|
||||
import { useDirectories } from './use-directories';
|
||||
import { useResolvedSubplebbitAddress } from './use-resolved-subplebbit-address';
|
||||
import { useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useAccountComment } from '@bitsocialnet/bitsocial-react-hooks';
|
||||
import useSpecialThemeStore from '../stores/use-special-theme-store';
|
||||
import { isChristmas } from '../lib/utils/time-utils';
|
||||
import { updateFavicon, isSfwBoard } from '../lib/update-favicon';
|
||||
|
||||
Reference in New Issue
Block a user