@@ -58,7 +58,7 @@ $(document).ready(function () {
58
58
$ ( '#loading' ) . show ( ) ;
59
59
60
60
// get dev profile
61
- setTimeout ( function ( ) {
61
+ setTimeout ( async function ( ) {
62
62
puter . ui . onLaunchedWithItems ( async function ( items ) {
63
63
source_path = items [ 0 ] . path ;
64
64
// if source_path is provided, this means that the user is creating a new app/updating an existing app
@@ -71,48 +71,50 @@ $(document).ready(function () {
71
71
}
72
72
} )
73
73
74
- puter . apps . getDeveloperProfile ( async function ( dev_profile ) {
75
- developer = dev_profile ;
76
- if ( dev_profile . approved_for_incentive_program && ! dev_profile . joined_incentive_program ) {
77
- $ ( '#join-incentive-program' ) . show ( ) ;
78
- }
74
+ if ( domain === 'puter.com' ) {
75
+ puter . apps . getDeveloperProfile ( async function ( dev_profile ) {
76
+ developer = dev_profile ;
77
+ if ( dev_profile . approved_for_incentive_program && ! dev_profile . joined_incentive_program ) {
78
+ $ ( '#join-incentive-program' ) . show ( ) ;
79
+ }
79
80
80
- // show earn money c2a only if dev is not approved for incentive program or has already joined
81
- if ( ! dev_profile . approved_for_incentive_program || dev_profile . joined_incentive_program ) {
82
- puter . kv . get ( 'earn-money-c2a-closed' ) . then ( ( value ) => {
83
- if ( value ?. result || value === true || value === "true" )
84
- return ;
81
+ // show earn money c2a only if dev is not approved for incentive program or has already joined
82
+ if ( ! dev_profile . approved_for_incentive_program || dev_profile . joined_incentive_program ) {
83
+ puter . kv . get ( 'earn-money-c2a-closed' ) . then ( ( value ) => {
84
+ if ( value ?. result || value === true || value === "true" )
85
+ return ;
85
86
86
- $ ( '#earn-money' ) . get ( 0 ) . showModal ( ) ;
87
- } ) ;
88
- }
87
+ $ ( '#earn-money' ) . get ( 0 ) . showModal ( ) ;
88
+ } ) ;
89
+ }
89
90
90
- // get apps
91
- puter . apps . list ( ) . then ( ( resp ) => {
92
- apps = resp ;
91
+ // show payout method tab if dev has joined incentive program
92
+ if ( dev_profile . joined_incentive_program ) {
93
+ $ ( '.tab-btn[data-tab="payout-method"]' ) . show ( ) ;
94
+ $ ( '#payout-method-email' ) . html ( dev_profile . paypal ) ;
95
+ }
96
+ } )
97
+ }
98
+ // get apps
99
+ puter . apps . list ( ) . then ( ( resp ) => {
100
+ apps = resp ;
93
101
94
- // hide loading
95
- $ ( '#loading' ) . hide ( ) ;
102
+ // hide loading
103
+ $ ( '#loading' ) . hide ( ) ;
96
104
97
- // set apps
98
- if ( apps . length > 0 ) {
99
- if ( activeTab === 'apps' ) {
100
- $ ( '#no-apps-notice' ) . hide ( ) ;
101
- $ ( '#app-list' ) . show ( ) ;
102
- }
103
- $ ( '.app-card' ) . remove ( ) ;
104
- apps . forEach ( app => {
105
- $ ( '#app-list-table > tbody' ) . append ( generate_app_card ( app ) ) ;
106
- } ) ;
107
- sort_apps ( ) ;
108
- } else {
109
- $ ( '#no-apps-notice' ) . show ( ) ;
105
+ // set apps
106
+ if ( apps . length > 0 ) {
107
+ if ( activeTab === 'apps' ) {
108
+ $ ( '#no-apps-notice' ) . hide ( ) ;
109
+ $ ( '#app-list' ) . show ( ) ;
110
110
}
111
- } )
112
- // show payout method tab if dev has joined incentive program
113
- if ( dev_profile . joined_incentive_program ) {
114
- $ ( '.tab-btn[data-tab="payout-method"]' ) . show ( ) ;
115
- $ ( '#payout-method-email' ) . html ( dev_profile . paypal ) ;
111
+ $ ( '.app-card' ) . remove ( ) ;
112
+ apps . forEach ( app => {
113
+ $ ( '#app-list-table > tbody' ) . append ( generate_app_card ( app ) ) ;
114
+ } ) ;
115
+ sort_apps ( ) ;
116
+ } else {
117
+ $ ( '#no-apps-notice' ) . show ( ) ;
116
118
}
117
119
} )
118
120
} , 1000 ) ;
0 commit comments