Skip to content

Commit 702141c

Browse files
authored
Merge pull request #116 from odefun/feat/remove-sync-workspace-button-394959
fix: remove sync workspace button from general settings
2 parents 9ab5841 + 9a7bcd5 commit 702141c

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ode",
3-
"version": "0.0.78",
3+
"version": "0.0.79",
44
"description": "Coding anywhere with your coding agents connected",
55
"module": "packages/core/index.ts",
66
"type": "module",

packages/ims/slack/commands.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
getChannelAgentProvider,
44
getChannelModel,
55
resolveChannelCwd,
6-
getWorkspaces,
76
getEnabledAgentProviders,
87
getOpenCodeModels,
98
getCodexModels,
@@ -20,17 +19,14 @@ import {
2019
setGitHubInfoForUser,
2120
getUserGeneralSettings,
2221
setUserGeneralSettings,
23-
invalidateOdeConfigCache,
2422
} from "@/config";
2523
import { startServer as startOpenCodeServer } from "@/agents/opencode";
2624
import { startServer as startCodexServer } from "@/agents/codex";
27-
import { syncSlackWorkspace } from "@/core/web/local-settings";
2825

2926
const SETTINGS_LAUNCH_ACTION = "open_settings_modal";
3027
const SETTINGS_MODAL_ID = "settings_modal";
3128
const GENERAL_SETTINGS_LAUNCH_ACTION = "open_general_settings_modal";
3229
const GENERAL_SETTINGS_MODAL_ID = "general_settings_modal";
33-
const GENERAL_SYNC_WORKSPACE_ACTION = "general_sync_workspace";
3430
const GITHUB_LAUNCH_ACTION = "open_github_token_modal";
3531
const GITHUB_MODAL_ID = "github_token_modal";
3632
const GITHUB_TOKEN_BLOCK = "github_token";
@@ -516,18 +512,6 @@ function buildGeneralSettingsModal(params: {
516512
?? autoUpdateOptions[0],
517513
},
518514
},
519-
{
520-
type: "actions" as const,
521-
elements: [
522-
{
523-
type: "button" as const,
524-
action_id: GENERAL_SYNC_WORKSPACE_ACTION,
525-
text: { type: "plain_text" as const, text: "Sync Workspace" },
526-
style: "primary" as const,
527-
value: channelId,
528-
},
529-
],
530-
},
531515
],
532516
};
533517
}
@@ -624,42 +608,6 @@ export function setupInteractiveHandlers(): void {
624608
});
625609
});
626610

627-
slackApp.action(GENERAL_SYNC_WORKSPACE_ACTION, async ({ ack, body, client }) => {
628-
await ack();
629-
630-
const actionBody = body as SlackActionBody;
631-
632-
const channelId = getActionChannelId(actionBody)
633-
?? getActionViewMetadata(actionBody)
634-
?? actionBody.channel?.id;
635-
const userId = getActionUserId(actionBody);
636-
if (!channelId || !userId) return;
637-
638-
const workspaces = getWorkspaces();
639-
const syncResults = await Promise.allSettled(
640-
workspaces.map(async (workspace) => syncSlackWorkspace(workspace.id))
641-
);
642-
643-
const successful = syncResults
644-
.filter((result): result is PromiseFulfilledResult<Awaited<ReturnType<typeof syncSlackWorkspace>>> => result.status === "fulfilled")
645-
.map((result) => result.value);
646-
const syncedWorkspaces = successful.length;
647-
const syncedChannels = successful.reduce((sum, workspace) => sum + (workspace.channels ?? workspace.channelDetails.length), 0);
648-
const failedWorkspaces = syncResults.length - syncedWorkspaces;
649-
650-
invalidateOdeConfigCache();
651-
652-
const message = failedWorkspaces > 0
653-
? `Synced ${syncedWorkspaces} workspaces with ${syncedChannels} channels in total. Failed to sync ${failedWorkspaces} workspaces.`
654-
: `Synced ${syncedWorkspaces} workspaces with ${syncedChannels} channels in total.`;
655-
656-
await client.chat.postEphemeral({
657-
channel: channelId,
658-
user: userId,
659-
text: message,
660-
});
661-
});
662-
663611
slackApp.action(PROVIDER_ACTION, async ({ ack, body, client }) => {
664612
await ack();
665613

0 commit comments

Comments
 (0)