Skip to content

Commit

Permalink
Hoist <user-coms-dialog> to the root element.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Apr 8, 2024
1 parent 36d69ca commit 0fc71fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion client/src/www/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export class App {
console.error(`Failed to read auto-connect dialog status, assuming not dismissed: ${e}`);
}
if (!dismissed) {
this.rootEl.$.serversView.$.autoConnectDialog.show();
this.rootEl.$.autoConnectDialog.show();
}
}

Expand Down
8 changes: 8 additions & 0 deletions client/src/www/ui_components/app-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,14 @@ export class AppRoot extends mixinBehaviors([AppLocalizeBehavior], PolymerElemen
root-path="[[rootPath]]"
localize="[[localize]]"
></server-rename-dialog>
<user-comms-dialog
id="autoConnectDialog"
localize="[[localize]]"
title-localization-key="auto-connect-dialog-title"
detail-localization-key="auto-connect-dialog-detail"
fire-event-on-hide="AutoConnectDialogDismissed"
></user-comms-dialog>
`;
}

Expand Down
15 changes: 1 addition & 14 deletions client/src/www/views/servers_view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class ServerList extends LitElement {
return unsafeHTML(msg);
}

private get renderMainContent(): TemplateResult {
render() {
if (this.shouldShowZeroState) {
return html`
<button type="button" @click=${this.requestPromptAddServer}>
Expand All @@ -165,17 +165,4 @@ export class ServerList extends LitElement {
`;
}
}

render() {
return html`
${this.renderMainContent}
<user-comms-dialog
id="autoConnectDialog"
.localize=${this.localize}
title-localization-key="auto-connect-dialog-title"
detail-localization-key="auto-connect-dialog-detail"
fire-event-on-hide="AutoConnectDialogDismissed"
></user-comms-dialog>
`;
}
}

0 comments on commit 0fc71fc

Please sign in to comment.