Skip to content

Commit a1f1814

Browse files
committed
fix(browser): keep flag sync at host seam
Generated-By: PostHog Code Task-Id: b23f944d-dd7f-465b-9fed-1a1d028f35e1
1 parent 648d3b8 commit a1f1814

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

apps/code/src/renderer/contributions/browser-view.contribution.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import type { Contribution } from "@posthog/di/contribution";
22
import { BROWSER_TAB_FLAG } from "@posthog/shared/constants";
3-
import {
4-
FEATURE_FLAGS,
5-
type FeatureFlags,
6-
} from "@posthog/ui/features/feature-flags/identifiers";
3+
import type { FeatureFlags } from "@posthog/ui/features/feature-flags/identifiers";
74
import { trpcClient } from "@renderer/trpc/client";
8-
import { inject, injectable } from "inversify";
95

10-
@injectable()
116
export class BrowserViewContribution implements Contribution {
12-
constructor(
13-
@inject(FEATURE_FLAGS) private readonly featureFlags: FeatureFlags,
14-
) {}
7+
constructor(private readonly featureFlags: FeatureFlags) {}
158

169
start(): void {
1710
const sync = (): void => {

apps/code/src/renderer/desktop-contributions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { browserTabsUiModule } from "@posthog/ui/features/browser-tabs/browser-t
1616
import { cloneUiModule } from "@posthog/ui/features/clone/clone.module";
1717
import { connectivityUiModule } from "@posthog/ui/features/connectivity/connectivity.module";
1818
import { discordPresenceUiModule } from "@posthog/ui/features/discord-presence/discordPresence.module";
19+
import { FEATURE_FLAGS } from "@posthog/ui/features/feature-flags/identifiers";
1920
import { fileWatcherUiModule } from "@posthog/ui/features/file-watcher/file-watcher.module";
2021
import { focusUiModule } from "@posthog/ui/features/focus/focus.module";
2122
import { notificationsUiModule } from "@posthog/ui/features/notifications/notifications.module";
@@ -61,6 +62,8 @@ export function registerDesktopContributions(): void {
6162
}
6263

6364
container.bind(CONTRIBUTION).to(AnalyticsBootContribution).inSingletonScope();
64-
container.bind(CONTRIBUTION).to(BrowserViewContribution).inSingletonScope();
65+
container
66+
.bind(CONTRIBUTION)
67+
.toConstantValue(new BrowserViewContribution(container.get(FEATURE_FLAGS)));
6568
container.bind(CONTRIBUTION).to(InboxDemoDevContribution).inSingletonScope();
6669
}

0 commit comments

Comments
 (0)