Service console check providers

This commit is contained in:
Stijnus
2025-01-30 01:58:47 +01:00
parent 9e8d05cb54
commit d9a380f28a
22 changed files with 1476 additions and 104 deletions

View File

@@ -38,8 +38,9 @@ export const shortcutsStore = map<Shortcuts>({
},
toggleTheme: {
key: 'd',
ctrlOrMetaKey: true,
altKey: true,
metaKey: true, // Command key on Mac, Windows key on Windows
altKey: true, // Option key on Mac, Alt key on Windows
shiftKey: true,
action: () => toggleTheme(),
},
toggleChat: {

View File

@@ -27,8 +27,28 @@ function initStore() {
export function toggleTheme() {
const currentTheme = themeStore.get();
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
// Update the theme store
themeStore.set(newTheme);
logStore.logSystem(`Theme changed to ${newTheme} mode`);
// Update localStorage
localStorage.setItem(kTheme, newTheme);
// Update the HTML attribute
document.querySelector('html')?.setAttribute('data-theme', newTheme);
// Update user profile if it exists
try {
const userProfile = localStorage.getItem('bolt_user_profile');
if (userProfile) {
const profile = JSON.parse(userProfile);
profile.theme = newTheme;
localStorage.setItem('bolt_user_profile', JSON.stringify(profile));
}
} catch (error) {
console.error('Error updating user profile theme:', error);
}
logStore.logSystem(`Theme changed to ${newTheme} mode`);
}