Skip to content

Commit

Permalink
Frontend bot logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Feb 13, 2024
1 parent 8e0e99a commit d617adc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/views/IntegrationsPage/IntegrationsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const IntegrationsPage = withProjectPermission(
isIntegrationsAuthorizedEmpty &&
isIntegrationsEmpty
) {
if (bot?.id)
if (bot?.id && currentWorkspace?.version === "v1")
updateBotActiveStatusSync({
isActive: false,
botId: bot.id,
Expand All @@ -113,7 +113,7 @@ export const IntegrationsPage = withProjectPermission(
if (!selectedCloudIntegration) return;

try {
if (bot && !bot.isActive) {
if (bot && !bot.isActive && currentWorkspace?.version === "v1") {
const botKey = generateBotKey(bot.publicKey, latestWsKey!);
await updateBotActiveStatus({
workspaceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const E2EESection = () => {
* 3. Encrypt project key with bot's public key
* 4. Send encrypted project key to backend and set bot status to active
*/

const toggleBotActivate = async () => {
let botKey;
try {
Expand Down Expand Up @@ -75,7 +76,9 @@ export const E2EESection = () => {
}
};

return bot ? (
if (!currentWorkspace) return null;

return bot && currentWorkspace.version === "v1" ? (
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<p className="mb-3 text-xl font-semibold">End-to-End Encryption</p>
<p className="mb-8 text-gray-400">
Expand Down

0 comments on commit d617adc

Please sign in to comment.