Make sure the auth error message is shown

This commit is contained in:
Travis Ralston 2018-05-20 18:25:37 -06:00
parent a249d6dd68
commit 31c565abc9

View File

@ -38,12 +38,16 @@ export class StickerPickerWidgetWrapperComponent extends CapableWidget implement
if (!params.widgetId) { if (!params.widgetId) {
console.error("No widgetId query parameter"); console.error("No widgetId query parameter");
this.authError = true; this.authError = true;
this.isLoading = false;
} else { } else {
ScalarWidgetApi.widgetId = params.widgetId; ScalarWidgetApi.widgetId = params.widgetId;
} }
if (!this.authError) {
SessionStorage.scalarToken = token; SessionStorage.scalarToken = token;
this.authError = !token; this.authError = !token;
this.isLoading = !this.authError;
}
} }
public ngOnInit() { public ngOnInit() {
@ -77,6 +81,7 @@ export class StickerPickerWidgetWrapperComponent extends CapableWidget implement
} catch (e) { } catch (e) {
console.error(e); console.error(e);
this.authError = true; this.authError = true;
this.isLoading = false;
return; return;
} }
} }