Skip to content

Commit

Permalink
fix: don't fetch server in client
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Feb 12, 2024
1 parent e3090bc commit a4ac96e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tw-mobile-sync/server/browser-background-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class BackgroundSyncManager {
async getConnectedClientStatus() {
try {
const baseUrl = $tw.wiki.getTiddlerText('$:/info/url/full');
if (baseUrl?.startsWith?.('http') !== true) {
clearInterval(this.loop);
return;
}
const response: Record<string, IClientInfo> = await fetch(getClientInfoPoint(baseUrl)).then(
async (response) => (await response.json()) as Record<string, IClientInfo>,
);
Expand Down

0 comments on commit a4ac96e

Please sign in to comment.