From e899616081f8139c253eb990ada765b8a3d81e21 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 9 Nov 2021 17:28:59 -0800 Subject: [PATCH] fix: Changing team settings should update in other tabs --- app/components/SocketProvider.js | 4 ++++ app/scenes/Settings/Features.js | 5 ++--- server/queues/processors/websockets.js | 11 +++++++++++ shared/i18n/locales/en_US/translation.json | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/components/SocketProvider.js b/app/components/SocketProvider.js index 9135e14b..321ddc95 100644 --- a/app/components/SocketProvider.js +++ b/app/components/SocketProvider.js @@ -243,6 +243,10 @@ class SocketProvider extends React.Component { } } } + + if (event.teamIds) { + await auth.fetch(); + } }); this.socket.on("documents.star", (event) => { diff --git a/app/scenes/Settings/Features.js b/app/scenes/Settings/Features.js index dc6e1e5d..eb3cda65 100644 --- a/app/scenes/Settings/Features.js +++ b/app/scenes/Settings/Features.js @@ -59,9 +59,8 @@ function Features() { onChange={handleChange} note={ - When enabled multiple people can edit documents at the same time. - Please note that this feature is in beta and currently disables - updating the document via the API. + When enabled multiple people can edit documents at the same time + with shared presence and live cursors. } /> diff --git a/server/queues/processors/websockets.js b/server/queues/processors/websockets.js index 69dabd4b..c0cd17b1 100644 --- a/server/queues/processors/websockets.js +++ b/server/queues/processors/websockets.js @@ -499,6 +499,17 @@ export default class WebsocketsProcessor { return; } + case "teams.update": { + return socketio.to(`team-${event.teamId}`).emit("entities", { + event: event.name, + teamIds: [ + { + id: event.teamId, + }, + ], + }); + } + default: } } diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 5994b7e5..40c578d0 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -531,7 +531,7 @@ "Your knowledge base will be accessible at": "Your knowledge base will be accessible at", "Manage optional and beta features. Changing these settings will affect the experience for all team members.": "Manage optional and beta features. Changing these settings will affect the experience for all team members.", "Collaborative editing": "Collaborative editing", - "When enabled multiple people can edit documents at the same time. Please note that this feature is in beta and currently disables updating the document via the API.": "When enabled multiple people can edit documents at the same time. Please note that this feature is in beta and currently disables updating the document via the API.", + "When enabled multiple people can edit documents at the same time with shared presence and live cursors.": "When enabled multiple people can edit documents at the same time with shared presence and live cursors.", "New group": "New group", "Groups can be used to organize and manage the people on your team.": "Groups can be used to organize and manage the people on your team.", "All groups": "All groups",