diff --git a/src/activity.ts b/src/activity.ts index 9578aaa..4e523db 100644 --- a/src/activity.ts +++ b/src/activity.ts @@ -112,6 +112,7 @@ export const activity = async ( const stateEnabled = config.get(CONFIG_KEYS.Status.State.Enabled); const stateIdleEnabled = config.get(CONFIG_KEYS.Status.State.Idle.Enabled); const privacyModeEnabled = config.get(CONFIG_KEYS.App.PrivacyMode) as boolean; + const workspacePrivacy = config.get(CONFIG_KEYS.App.WorkspacePrivacyMode) as boolean; const gitRepo = dataClass.gitRemoteUrl?.toString("https").replace(/\.git$/, ""); const gitOrg = dataClass.gitRemoteUrl?.organization ?? dataClass.gitRemoteUrl?.owner; @@ -157,6 +158,9 @@ export const activity = async ( if (privacyModeEnabled) { replaced = await replaceForPrivacyMode(replaced); } + if (workspacePrivacy) { + replaced = await workspacePrivacyReplace(replaced); + } replaced = replaceAppInfo(replaced); replaced = replaceGitInfo(replaced, isGitExcluded); replaced = await replaceFileInfo( @@ -182,6 +186,15 @@ export const activity = async ( return replaced; }; + const workspacePrivacyReplace = async (text: string) => { + let replaced: string = text; + replaced = replaced.replaceAll("{workspace}", "a workspace"); + replaced = replaced.replaceAll("{workspace_folder}", "a workspace"); + replaced = replaced.replaceAll("{workspace_and_folder}", "a workspace"); + + return replaced; + }; + let workspaceExcludedText = "No workspace ignore text provided."; const ignoreWorkspacesText = config.get(CONFIG_KEYS.Ignore.WorkspacesText)!; diff --git a/src/constants.ts b/src/constants.ts index d04efc1..5968f76 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -14,6 +14,7 @@ export const CONFIG_KEYS = { Id: "app.id" as const, Name: "app.name" as const, PrivacyMode: "app.privacyMode.enable" as const, + WorkspacePrivacyMode: "app.workspacePrivacy.enable" as const, WhitelistEnabled: "app.whitelistEnabled" as const, whitelistIsBlacklist: "app.whitelistIsBlacklist" as const, Whitelist: "app.whitelist" as const