forked from MapComplete/MapComplete
refactoring: slight cleanup of tests
This commit is contained in:
parent
2e9b1016de
commit
f8d34648a0
28 changed files with 252 additions and 353 deletions
|
@ -1,5 +1,7 @@
|
|||
import LayerConfig from "./ThemeConfig/LayerConfig"
|
||||
import { UIEventSource } from "../Logic/UIEventSource"
|
||||
import UserRelatedState from "../Logic/State/UserRelatedState"
|
||||
import { Utils } from "../Utils"
|
||||
|
||||
/**
|
||||
* Indicates if a menu is open, and if so, which tab is selected;
|
||||
|
@ -61,6 +63,19 @@ export class MenuState {
|
|||
public openUsersettings(highlightTagRendering?: string) {
|
||||
this.menuIsOpened.setData(true)
|
||||
this.menuViewTab.setData("settings")
|
||||
if (
|
||||
highlightTagRendering !== undefined &&
|
||||
!UserRelatedState.availableUserSettingsIds.some((tr) => tr === highlightTagRendering)
|
||||
) {
|
||||
console.error(
|
||||
"No tagRendering with id '" + highlightTagRendering + "'; maybe you meant:",
|
||||
Utils.sortedByLevenshteinDistance(
|
||||
highlightTagRendering,
|
||||
UserRelatedState.availableUserSettingsIds,
|
||||
(x) => x
|
||||
)
|
||||
)
|
||||
}
|
||||
this.highlightedUserSetting.setData(highlightTagRendering)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue