ciyidogan commited on
Commit
ba36fe4
·
verified ·
1 Parent(s): 3fc7fec

Update flare-ui/src/app/components/projects/projects.component.ts

Browse files
flare-ui/src/app/components/projects/projects.component.ts CHANGED
@@ -65,6 +65,17 @@ export class ProjectsComponent implements OnInit {
65
 
66
  ngOnInit() {
67
  this.loadProjects();
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
  async loadProjects() {
@@ -79,6 +90,17 @@ export class ProjectsComponent implements OnInit {
79
  }
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
82
  applyFilter() {
83
  this.filteredProjects = this.projects.filter(project => {
84
  const matchesSearch = !this.searchTerm ||
 
65
 
66
  ngOnInit() {
67
  this.loadProjects();
68
+ this.loadEnvironment();
69
+ }
70
+
71
+ isSparkTabVisible(): boolean {
72
+ // Environment bilgisini cache'ten al (eğer varsa)
73
+ const env = localStorage.getItem('flare_environment');
74
+ if (env) {
75
+ const config = JSON.parse(env);
76
+ return !config.work_mode?.startsWith('gpt4o');
77
+ }
78
+ return true; // Default olarak göster
79
  }
80
 
81
  async loadProjects() {
 
90
  }
91
  }
92
 
93
+ private loadEnvironment() {
94
+ this.apiService.getEnvironment().subscribe({
95
+ next: (env) => {
96
+ localStorage.setItem('flare_environment', JSON.stringify(env));
97
+ },
98
+ error: (err) => {
99
+ console.error('Failed to load environment:', err);
100
+ }
101
+ });
102
+ }
103
+
104
  applyFilter() {
105
  this.filteredProjects = this.projects.filter(project => {
106
  const matchesSearch = !this.searchTerm ||