mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Fix empty board loading state and browser P2P patch (#1175)
* fix(board): show loaded empty boards * fix(p2p): patch browser hooks runtime * fix(board): stop flash loading for explicit empty boards * fix(board): wait for feed on preloaded empty pages
This commit is contained in:
@@ -61,6 +61,46 @@ describe('getRawBoardThreadState', () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('treats explicit empty page CIDs as a fully loaded empty board', () => {
|
||||
const community = {
|
||||
posts: {
|
||||
pageCids: {},
|
||||
pages: {},
|
||||
},
|
||||
updatedAt: 1781773422,
|
||||
} as Community;
|
||||
|
||||
expect(
|
||||
getRawBoardThreadState({
|
||||
accountId: undefined,
|
||||
communitiesPages: {} as CommunitiesPages,
|
||||
community,
|
||||
sortType: 'active',
|
||||
}),
|
||||
).toMatchObject({
|
||||
isFullyLoaded: true,
|
||||
rootThreadCids: new Set<string>(),
|
||||
});
|
||||
});
|
||||
|
||||
it('does not treat placeholder empty page CIDs as fully loaded', () => {
|
||||
const community = {
|
||||
posts: {
|
||||
pageCids: {},
|
||||
pages: {},
|
||||
},
|
||||
} as Community;
|
||||
|
||||
expect(
|
||||
getRawBoardThreadState({
|
||||
accountId: undefined,
|
||||
communitiesPages: {} as CommunitiesPages,
|
||||
community,
|
||||
sortType: 'active',
|
||||
}).isFullyLoaded,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('walks stored board pages without importing side-effectful stores', () => {
|
||||
const community = {
|
||||
posts: {
|
||||
|
||||
Reference in New Issue
Block a user