Skip to content

Commit 6a62d4f

Browse files
authored
don't show banner in serverless web (microsoft#163959)
1 parent 7ea2788 commit 6a62d4f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr
4545
import { ILabelService } from 'vs/platform/label/common/label';
4646
import { IProductService } from 'vs/platform/product/common/productService';
4747
import { MANAGE_TRUST_COMMAND_ID, WorkspaceTrustContext } from 'vs/workbench/contrib/workspace/common/workspace';
48+
import { isWeb } from 'vs/base/common/platform';
49+
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
4850

4951
const BANNER_RESTRICTED_MODE = 'workbench.banner.restrictedMode';
5052
const STARTUP_PROMPT_SHOWN_KEY = 'workspace.trust.startupPrompt.shown';
@@ -220,7 +222,8 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
220222
@IBannerService private readonly bannerService: IBannerService,
221223
@ILabelService private readonly labelService: ILabelService,
222224
@IHostService private readonly hostService: IHostService,
223-
@IProductService private readonly productService: IProductService
225+
@IProductService private readonly productService: IProductService,
226+
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
224227
) {
225228
super();
226229

@@ -490,7 +493,14 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
490493

491494

492495
private get bannerSetting(): 'always' | 'untilDismissed' | 'never' {
493-
return this.configurationService.getValue(WORKSPACE_TRUST_BANNER);
496+
const result = this.configurationService.getValue<'always' | 'untilDismissed' | 'never'>(WORKSPACE_TRUST_BANNER);
497+
498+
// In serverless environments, we don't need to aggressively show the banner
499+
if (result !== 'always' && isWeb && !this.remoteAgentService.getConnection()?.remoteAuthority) {
500+
return 'never';
501+
}
502+
503+
return result;
494504
}
495505

496506
//#endregion

0 commit comments

Comments
 (0)