Skip to content

Commit

Permalink
Add feature define Color Mode from client
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed May 31, 2024
1 parent a7a339e commit 8d83bd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/library/astroid/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ public function getColorMode() {

$color_mode_theme = '';
if ($plg_color_mode && $color_mode) {
$color_mode_theme = Factory::getApplication()->input->cookie->get('astroid-color-mode-'.md5($this->template), $color_mode_default);
$app = Factory::getApplication();
$client_color = $app->input->get('color_mode', '', 'ALNUM');
$color_mode_theme = !empty($client_color) ? $client_color : $app->input->cookie->get('astroid-color-mode-'.md5($this->template), $color_mode_default);
}
return $color_mode_theme;
}
Expand Down

0 comments on commit 8d83bd1

Please sign in to comment.