Import button only shows up when logged in

This commit is contained in:
pietervdvn 2021-10-06 14:14:41 +02:00
parent dc4174047a
commit 4295f4a9be

View file

@ -54,6 +54,19 @@ export default class ImportButton extends Toggle {
new Combine([button, appliedTags]).SetClass("flex flex-col"),
State.state.featurePipeline.runningQuery
)
super(t.hasBeenImported, withLoadingCheck, isImported)
const importButton = new Toggle(t.hasBeenImported, withLoadingCheck, isImported)
const pleaseLoginButton =
new Toggle(t.pleaseLogin.Clone()
.onClick(() => State.state.osmConnection.AttemptLogin())
.SetClass("login-button-friendly"),
undefined,
State.state.featureSwitchUserbadge)
super(importButton,
pleaseLoginButton,
State.state.osmConnection.isLoggedIn
)
}
}