File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export const usersData = {
15
15
verified : null ,
16
16
} ;
17
17
const urlParams = new URLSearchParams ( window . location . search ) ;
18
+ const isDev = urlParams . get ( 'dev' ) === 'true' ;
18
19
19
20
let activeTab = urlParams . get ( 'tab' ) ?? 'in_discord' ;
20
21
const INITIAL_USERS = 10 ;
@@ -25,7 +26,9 @@ let showUser = 0;
25
26
/* this is the original function for fetching user data from the API, will remove it once
26
27
the API pagination issue is resolved. Currently testing pagination using mock data.
27
28
*/
29
+
28
30
// usersData[activeTab] = await getUsers(activeTab);
31
+
29
32
// add feature flag(feature should be only visible when query params dev=true)
30
33
31
34
export const paginateFetchedUsers = async ( tabId , page = 1 ) => {
@@ -53,6 +56,7 @@ export const paginateFetchedUsers = async (tabId, page = 1) => {
53
56
usersData [ tabId ] = [ ...usersData [ tabId ] , ...uniqueNewUsers ] ;
54
57
}
55
58
currentPage = page ;
59
+ console . log ( usersData [ tabId ] ) ;
56
60
}
57
61
} catch ( error ) {
58
62
console . error ( 'Error fetching users' , error ) ;
@@ -114,5 +118,6 @@ export const App = () => {
114
118
NoUserFound ( ) ,
115
119
] ) ;
116
120
} ;
117
-
118
- paginateFetchedUsers ( activeTab , 1 ) ;
121
+ if ( isDev ) {
122
+ paginateFetchedUsers ( activeTab , 1 ) ;
123
+ }
You can’t perform that action at this time.
0 commit comments