From ced5608c9608f0af199242c3baa8a9d144051445 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Thu, 9 Jun 2011 16:49:24 +0100 Subject: [PATCH] Don't ask for the requestToken if we haven't told OAuthPanel which connection to use yet --- REFACTOR.txt | 1 - net/systemeD/potlatch2/save/OAuthPanel.mxml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/REFACTOR.txt b/REFACTOR.txt index 391dbacf..dc76e3de 100644 --- a/REFACTOR.txt +++ b/REFACTOR.txt @@ -8,7 +8,6 @@ To check: - MapDust - VectorLayers from GPX - VectorLayers from shapefiles -- Save/OAuth not tested - removeLayer in MapPaint.as should blank - does it? == Changes overall == diff --git a/net/systemeD/potlatch2/save/OAuthPanel.mxml b/net/systemeD/potlatch2/save/OAuthPanel.mxml index 5a9285fc..f972f927 100644 --- a/net/systemeD/potlatch2/save/OAuthPanel.mxml +++ b/net/systemeD/potlatch2/save/OAuthPanel.mxml @@ -81,6 +81,7 @@ private var _accessToken:OAuthToken; private var authoriseURL:String; private var lastHTTPStatus:int = 0; + private var waiting:Boolean = false; public static var ACCESS_TOKEN_EVENT:String = "gotAccessToken"; @@ -91,6 +92,7 @@ public function setConnection(connection:Connection):void { this.connection=connection; + if (waiting) { waiting=false; getRequestToken(); } } private function openURL(url:String):void { @@ -109,6 +111,8 @@ } private function getRequestToken():void { + if (!connection) { waiting=true; return; } // in case the connection hasn't been set yet + var sig:IOAuthSignatureMethod = new OAuthSignatureMethod_HMAC_SHA1(); var consumer:OAuthConsumer = getConsumer(); var url:String = connection.getParam("oauth_request_url", "http://127.0.0.1:3000/oauth/request_token"); -- 2.30.0