Skip to content

Commit 734c3bb

Browse files
Refresh communication queries on workspace change (#9723)
Signed-off-by: Kristina Fefelova <[email protected]>
1 parent 28ad28a commit 734c3bb

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

packages/presentation/src/communication.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
//
15-
import { initLiveQueries, refreshLiveQueries } from '@hcengineering/communication-client-query'
15+
import { closeLiveQueries, initLiveQueries, refreshLiveQueries } from '@hcengineering/communication-client-query'
1616
import {
1717
type AddAttachmentsOperation,
1818
type AddCollaboratorsEvent,
@@ -458,3 +458,8 @@ export async function refreshCommunicationClient (): Promise<void> {
458458
console.log('refreshCommunicationClient')
459459
await refreshLiveQueries()
460460
}
461+
462+
export async function purgeCommunicationClient (): Promise<void> {
463+
client.close()
464+
closeLiveQueries()
465+
}

plugins/workbench-resources/src/connect.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import platform, {
3535
import presentation, {
3636
loadServerConfig,
3737
purgeClient,
38+
purgeCommunicationClient,
3839
refreshClient,
3940
refreshCommunicationClient,
4041
setClient,
@@ -175,6 +176,7 @@ export async function connect (title: string): Promise<Client | undefined> {
175176
// We need to flush all data from memory
176177
await ctx.with('purge-client', {}, async () => {
177178
await purgeClient()
179+
await purgeCommunicationClient()
178180
})
179181
await ctx.with('close previous client', {}, async () => {
180182
await _client?.close()

0 commit comments

Comments
 (0)