|
1 | | -import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, signal, inject, computed } from '@angular/core'; |
| 1 | +import { Component, EventEmitter, Input, OnInit, Output, signal, inject, computed } from '@angular/core'; |
2 | 2 | import { CommonModule } from '@angular/common'; |
3 | 3 | import { FormsModule } from '@angular/forms'; |
4 | 4 | import { MatButtonModule } from '@angular/material/button'; |
@@ -32,7 +32,7 @@ interface ChatMessage { |
32 | 32 | RouterModule, |
33 | 33 | ], |
34 | 34 | }) |
35 | | -export class EditDatabaseSchemaComponent implements OnInit, AfterViewInit { |
| 35 | +export class EditDatabaseSchemaComponent implements OnInit { |
36 | 36 | @Input() connectionID: string; |
37 | 37 | @Input() showClose: boolean = false; |
38 | 38 | @Output() schemaApplied = new EventEmitter<void>(); |
@@ -60,18 +60,6 @@ export class EditDatabaseSchemaComponent implements OnInit, AfterViewInit { |
60 | 60 | return null; |
61 | 61 | }); |
62 | 62 |
|
63 | | - async ngAfterViewInit() { |
64 | | - const mermaid = await import('mermaid'); |
65 | | - const mermaidAPI = (mermaid.default ?? mermaid) as { initialize: (config: Record<string, unknown>) => void }; |
66 | | - const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches; |
67 | | - mermaidAPI.initialize({ |
68 | | - startOnLoad: false, |
69 | | - theme: isDark ? 'dark' : 'default', |
70 | | - }); |
71 | | - //@ts-expect-error dynamic load of mermaid |
72 | | - window.mermaid = mermaidAPI; |
73 | | - } |
74 | | - |
75 | 63 | ngOnInit(): void { |
76 | 64 | if (!this.connectionID) { |
77 | 65 | const id = this._route.snapshot.paramMap.get('connection-id'); |
|
0 commit comments