From 4295f4a9be77fe3318798a824b7219537e29fc76 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 6 Oct 2021 14:14:41 +0200 Subject: [PATCH] Import button only shows up when logged in --- UI/BigComponents/ImportButton.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/UI/BigComponents/ImportButton.ts b/UI/BigComponents/ImportButton.ts index 1604052647..8ec4bd232a 100644 --- a/UI/BigComponents/ImportButton.ts +++ b/UI/BigComponents/ImportButton.ts @@ -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 + ) } } \ No newline at end of file