mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-04 00:22:56 +00:00
Refactored theme provider to replace obsolete calls (#511)
This commit is contained in:
parent
cf17c643a0
commit
3587f547b5
@ -109,7 +109,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
|||||||
// Send a message to start the plugin system:
|
// Send a message to start the plugin system:
|
||||||
await this.MessageBus.SendMessage<bool>(this, Event.STARTUP_PLUGIN_SYSTEM);
|
await this.MessageBus.SendMessage<bool>(this, Event.STARTUP_PLUGIN_SYSTEM);
|
||||||
|
|
||||||
await this.themeProvider.WatchSystemPreference(this.SystemeThemeChanged);
|
await this.themeProvider.WatchSystemDarkModeAsync(this.SystemeThemeChanged);
|
||||||
await this.UpdateThemeConfiguration();
|
await this.UpdateThemeConfiguration();
|
||||||
this.LoadNavItems();
|
this.LoadNavItems();
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
|||||||
private async Task UpdateThemeConfiguration()
|
private async Task UpdateThemeConfiguration()
|
||||||
{
|
{
|
||||||
if (this.SettingsManager.ConfigurationData.App.PreferredTheme is Themes.SYSTEM)
|
if (this.SettingsManager.ConfigurationData.App.PreferredTheme is Themes.SYSTEM)
|
||||||
this.useDarkMode = await this.themeProvider.GetSystemPreference();
|
this.useDarkMode = await this.themeProvider.GetSystemDarkModeAsync();
|
||||||
else
|
else
|
||||||
this.useDarkMode = this.SettingsManager.ConfigurationData.App.PreferredTheme == Themes.DARK;
|
this.useDarkMode = this.SettingsManager.ConfigurationData.App.PreferredTheme == Themes.DARK;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user