Skip to content

Commit

Permalink
Delay check of incremental features until fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
gettinToasty committed Dec 12, 2024
1 parent 85fe6b5 commit c13cbec
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions app/services/highlighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,22 +711,25 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt

async init() {
super.init();
this.aiHighlighterEnabled = this.incrementalRolloutService.views.featureIsEnabled(
EAvailableFeatures.aiHighlighter,
);

if (this.aiHighlighterEnabled && !this.aiHighlighterUpdater) {
this.aiHighlighterUpdater = new AiHighlighterUpdater();
}
this.incrementalRolloutService.featuresReady.then(async () => {
this.aiHighlighterEnabled = this.incrementalRolloutService.views.featureIsEnabled(
EAvailableFeatures.aiHighlighter,
);

// check if ai highlighter is activated and we need to update it
if (
this.aiHighlighterEnabled &&
this.views.useAiHighlighter &&
(await this.aiHighlighterUpdater.isNewVersionAvailable())
) {
await this.startUpdater();
}
if (this.aiHighlighterEnabled && !this.aiHighlighterUpdater) {
this.aiHighlighterUpdater = new AiHighlighterUpdater();
}

// check if ai highlighter is activated and we need to update it
if (
this.aiHighlighterEnabled &&
this.views.useAiHighlighter &&
(await this.aiHighlighterUpdater.isNewVersionAvailable())
) {
await this.startUpdater();
}
});

//
this.views.clips.forEach(clip => {
Expand Down

0 comments on commit c13cbec

Please sign in to comment.