Skip to content

Commit

Permalink
Merge pull request #8840 from qmonmert/sonar050224
Browse files Browse the repository at this point in the history
Sonar: Fix code smells
  • Loading branch information
pascalgrimaud authored Feb 5, 2024
2 parents c1e998e + d22b394 commit d7c5079
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LandscapeElementId } from './LandscapeElementId';

export class LandscapeUnselectionTree {
public static EMPTY: LandscapeUnselectionTree = new LandscapeUnselectionTree([]);
public static readonly EMPTY: LandscapeUnselectionTree = new LandscapeUnselectionTree([]);

constructor(public readonly elements: LandscapeElementId[]) {}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/module/secondary/GetMediaPreference.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type ThemePreference = 'light-theme' | 'dark-theme';

export const getMediaPreference = (win: Window): ThemePreference => {
if (typeof win !== 'undefined' && win.matchMedia) {
if (win?.matchMedia) {
return win.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark-theme' : 'light-theme';
}
return 'light-theme';
Expand Down

0 comments on commit d7c5079

Please sign in to comment.