Jelajahi Sumber

fix(gui): drop the impossible slots-undefined guard in the ui-question plugin

ClientContext types ctx.slots as always present (inject-declared service);
the unnecessary-condition lint rule rejects the dead guard and its
fail-loud test premise. Load-order failure still surfaces loud through
the undeclared-slot registration path, covered by the remaining case.
imccyu 2 bulan lalu
induk
melakukan
afd7eb0dcf

+ 0 - 1
packages/client/ui-question/src/client/index.ts

@@ -29,7 +29,6 @@ function selectQuestion({ interactions }: ComposerChainProps): QuestionWait | nu
  */
 export function apply(ctx: ClientContext): void {
   const slots = ctx.slots
-  if (slots === undefined) throw new Error('ui-question: slots service unavailable')
   ctx.effect(
     () => slots.register({ name: 'conversation.composer', select: selectQuestion }, QuestionComposer),
     'ui-question: composer chain registration',

+ 0 - 4
packages/client/ui-question/tests/browser-plugin.spec.ts

@@ -31,10 +31,6 @@ describe('apply', () => {
     expect(inject).toEqual(['slots'])
   })
 
-  it('fails loud when the slots service is missing', () => {
-    expect(() => { apply(new Context()) }).toThrow(/slots service unavailable/)
-  })
-
   it('fails loud when no live entry has declared the composer slot', async () => {
     const ctx = new Context()
     await ctx.plugin(SlotsService).await()