Skip to content

Commit

Permalink
Merge pull request #445 from holochain-apps/backport/443
Browse files Browse the repository at this point in the history
backport #443
  • Loading branch information
mattyg authored Jan 10, 2025
2 parents dfeb37c + cd7199d commit 846a3f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ui/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ export const INPUT_MAX_FILENAME_LENGTH = 10;

export const ROLE_NAME = "relay";
export const ZOME_NAME = "relay";

// Polling intervals, used on conversations page
export const POLLING_INTERVAL_SLOW = 30 * 1000;
export const POLLING_INTERVAL_FAST = 2 * 1000;
17 changes: 13 additions & 4 deletions ui/src/routes/conversations/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
deriveCellMergedProfileContactInviteJoinedStore,
type MergedProfileContactInviteJoinedStore,
} from "$store/MergedProfileContactInviteJoinedStore";
import { POLLING_INTERVAL_FAST, POLLING_INTERVAL_SLOW } from "$config";
const conversationStore = getContext<{ getStore: () => ConversationStore }>(
"conversationStore",
Expand Down Expand Up @@ -86,11 +87,11 @@
if ($joined.count < 2) {
agentTimeout = setTimeout(() => {
loadProfiles();
}, 2000);
}, POLLING_INTERVAL_FAST);
} else {
agentTimeout = setTimeout(() => {
loadProfiles();
}, 15000);
}, POLLING_INTERVAL_SLOW);
}
}
Expand All @@ -106,7 +107,11 @@
if ($conversation.config === undefined) {
configTimeout = setTimeout(() => {
loadConfig();
}, 2000);
}, POLLING_INTERVAL_FAST);
} else {
configTimeout = setTimeout(() => {
loadConfig();
}, POLLING_INTERVAL_SLOW);
}
}
Expand All @@ -119,7 +124,11 @@
if ($messages.count === 0) {
messageTimeout = setTimeout(() => {
loadMessages();
}, 2000);
}, POLLING_INTERVAL_FAST);
} else {
messageTimeout = setTimeout(() => {
loadMessages();
}, POLLING_INTERVAL_SLOW);
}
}
Expand Down

0 comments on commit 846a3f1

Please sign in to comment.