File tree Expand file tree Collapse file tree 2 files changed +16
-17
lines changed
Expand file tree Collapse file tree 2 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -104,28 +104,27 @@ function setup() {
104104 const builder = new CustomTabsIntent . Builder ( ) ;
105105 let colorString = inAppBrowserOptions [ InAppBrowserModule . KEY_TOOLBAR_COLOR ] ;
106106 if ( colorString ) {
107- const color = parseColor ( colorString ) ;
108- if ( color ) {
109- try {
107+ try {
108+ const color = parseColor ( colorString ) ;
109+ if ( color ) {
110110 builder . setToolbarColor ( color . android ) ;
111111 this . isLightTheme = toolbarIsLight ( color . android ) ;
112- } catch ( error ) {
113- throw new Error (
114- "Invalid toolbar color '" + colorString + "': " + error . message ) ;
115112 }
113+ } catch ( error ) {
114+ throw new Error (
115+ "Invalid toolbar color '" + colorString + "': " + error . message ) ;
116116 }
117-
118117 }
119118 colorString = inAppBrowserOptions [ InAppBrowserModule . KEY_SECONDARY_TOOLBAR_COLOR ] ;
120119 if ( colorString ) {
121- const color = parseColor ( colorString ) ;
122- if ( color ) {
123- try {
120+ try {
121+ const color = parseColor ( colorString ) ;
122+ if ( color ) {
124123 builder . setSecondaryToolbarColor ( color . android ) ;
125- } catch ( error ) {
126- throw new Error (
127- "Invalid secondary toolbar color '" + colorString + "': " + error . message ) ;
128124 }
125+ } catch ( error ) {
126+ throw new Error (
127+ "Invalid secondary toolbar color '" + colorString + "': " + error . message ) ;
129128 }
130129 }
131130
Original file line number Diff line number Diff line change 11import { Color } from "@nativescript/core" ;
22
33export function parseColor ( color : string | Color ) {
4- if ( color && ! ( color instanceof Color ) ) {
5- return new Color ( color ) ;
6- }
7- return color as Color ;
4+ if ( color && ! ( color instanceof Color ) ) {
5+ return new Color ( color ) ;
6+ }
7+ return color as Color ;
88}
You can’t perform that action at this time.
0 commit comments