File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,7 +253,6 @@ export default async function PluginInclude(
253253 const oldText = $button . textContent ;
254254
255255 try {
256-
257256 if ( ! product ) throw new Error ( "Product not found" ) ;
258257 const apiStatus = await helpers . checkAPIStatus ( ) ;
259258
Original file line number Diff line number Diff line change @@ -286,23 +286,27 @@ function Buttons({
286286 isSupported = true ,
287287} ) {
288288 async function openPluginWebsite ( ) {
289- const user = await auth . getLoggedInUser ( ) ;
290- if ( ! user ) {
289+ try {
290+ const user = await auth . getLoggedInUser ( ) ;
291+ if ( ! user ) {
292+ CustomTabs . open (
293+ `${ config . BASE_URL } /login?redirect=app` ,
294+ { showTitle : true } ,
295+ ( ) => { } ,
296+ ( ) => { } ,
297+ ) ;
298+ return ;
299+ }
300+
291301 CustomTabs . open (
292- `${ config . BASE_URL } /login?redirect=app ` ,
302+ `${ config . BASE_URL } /plugin/ ${ id } ` ,
293303 { showTitle : true } ,
294304 ( ) => { } ,
295305 ( ) => { } ,
296306 ) ;
297- return ;
307+ } catch ( e ) {
308+ console . error ( e ) ;
298309 }
299-
300- CustomTabs . open (
301- `${ config . BASE_URL } /plugin/${ id } ` ,
302- { showTitle : true } ,
303- ( ) => { } ,
304- ( ) => { } ,
305- ) ;
306310 }
307311 if ( ! isSupported ) {
308312 return (
You can’t perform that action at this time.
0 commit comments