mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(p2p): disable browser pure P2P by default
New browser sessions use IPFS gateway mode unless the user explicitly enables pure P2P in advanced settings.
This commit is contained in:
@@ -81,7 +81,26 @@ describe('useBrowserPureP2PAccountUpgrade', () => {
|
||||
window.isElectron = false;
|
||||
});
|
||||
|
||||
it('upgrades stale gateway browser accounts and reloads after saving', async () => {
|
||||
it('does not upgrade stale gateway browser accounts when pure p2p is disabled by default', async () => {
|
||||
testState.account = {
|
||||
id: 'account-1',
|
||||
name: 'Account 1',
|
||||
pkcOptions: {
|
||||
httpRoutersOptions: ['https://router.old.example'],
|
||||
ipfsGatewayUrls: ['https://gateway.old.example'],
|
||||
pubsubKuboRpcClientsOptions: ['https://pubsub.old.example/api/v0'],
|
||||
},
|
||||
};
|
||||
testState.accounts = [testState.account];
|
||||
|
||||
await renderHook();
|
||||
|
||||
expect(testState.setAccountMock).not.toHaveBeenCalled();
|
||||
expect(reloadMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('upgrades stale gateway browser accounts when pure p2p is enabled and reloads after saving', async () => {
|
||||
localStorage.setItem('5chan:pure-p2p-browser-enabled', 'true');
|
||||
testState.account = {
|
||||
id: 'account-1',
|
||||
name: 'Account 1',
|
||||
|
||||
Reference in New Issue
Block a user