Skip to content

Commit 52b546c

Browse files
author
fangedShadow
committed
Merge remote-tracking branch 'origin/development' into bhavpreet_browse_lp
2 parents d6a6fa3 + 26d9871 commit 52b546c

35 files changed

Lines changed: 4001 additions & 371 deletions

public/index.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,21 @@ body.bm-dashboard-dark .table {
171171
}
172172

173173
body.dark-mode .table th,
174-
body.dark-mode .table td,
174+
body.dark-mode .table td {
175+
color: #ffffff !important;
176+
border-color: #3a506b;
177+
}
178+
175179
body.bm-dashboard-dark .table th,
176180
body.bm-dashboard-dark .table td {
177181
color: #ffffff !important;
178182
border-color: #3a506b;
179183
}
180184

185+
body.bm-dashboard-dark .table th{
186+
background-color: #2e5061 !important;
187+
}
188+
181189
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd),
182190
body.bm-dashboard-dark .table-striped > tbody > tr:nth-of-type(odd) {
183191
background-color: rgba(46, 80, 97, 0.5);

src/actions/authActions.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,40 @@ export const getHeaderData = userId => {
115115
};
116116
};
117117

118-
export const logoutUser = () => dispatch => {
118+
export const logoutUser = (isCrossTabLogout = false) => dispatch => {
119119
// Clear any active force-logout timer before logging out
120120
dispatch(stopForceLogout());
121+
122+
// Only signal other tabs if this is NOT a cross-tab logout
123+
// (to prevent infinite loops when responding to storage events)
124+
if (!isCrossTabLogout) {
125+
// Set a flag to signal other tabs to log out
126+
// This flag will trigger a storage event in other tabs
127+
localStorage.setItem('logoutFlag', 'true');
128+
129+
// Use BroadcastChannel API for more reliable cross-tab communication
130+
if (typeof BroadcastChannel !== 'undefined') {
131+
try {
132+
const channel = new BroadcastChannel('auth_sync');
133+
channel.postMessage({ type: 'logout', timestamp: Date.now() });
134+
// Close the channel after sending
135+
setTimeout(() => channel.close(), 100);
136+
} catch (error) {
137+
// eslint-disable-next-line no-console
138+
console.warn('BroadcastChannel not available:', error);
139+
}
140+
}
141+
142+
// Clear the logout flag after a short delay to allow other tabs to detect it
143+
// We use setTimeout to ensure the storage event fires first
144+
setTimeout(() => {
145+
localStorage.removeItem('logoutFlag');
146+
}, 500);
147+
}
148+
149+
// Remove the token
121150
localStorage.removeItem(tokenKey);
151+
122152
httpService.setjwt(false);
123153
dispatch(setCurrentUser(null));
124154
};

src/actions/eventActions.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import axios from 'axios';
2+
import { ENDPOINTS } from '~/utils/URL';
3+
4+
/**
5+
* Fetch events with optional filtering
6+
* @param {Object} params - Query parameters
7+
* @param {string} params.type - Filter by event type
8+
* @param {string} params.location - Filter by location
9+
* @param {number} params.page - Page number
10+
* @param {number} params.limit - Items per page
11+
* @param {string} params.sortBy - Sort field
12+
* @returns {Promise} API response
13+
*/
14+
export async function getEvents(params = {}) {
15+
try {
16+
const { type = '', location = '', page = 1, limit = 9, sortBy = 'date' } = params;
17+
const queryParams = new URLSearchParams();
18+
if (type) queryParams.append('type', type);
19+
if (location) queryParams.append('location', location);
20+
queryParams.append('page', page);
21+
queryParams.append('limit', limit);
22+
queryParams.append('sortBy', sortBy);
23+
24+
const url = `${ENDPOINTS.EVENTS}?${queryParams.toString()}`;
25+
const response = await axios.get(url);
26+
return Promise.resolve(response);
27+
} catch (error) {
28+
return {
29+
message: error.response?.data?.error || error.message,
30+
errorCode: error.response?.status,
31+
status: error.response?.status || 500,
32+
};
33+
}
34+
}
35+
36+
/**
37+
* Fetch available event types
38+
* @returns {Promise} API response
39+
*/
40+
export async function getEventTypes() {
41+
try {
42+
const url = ENDPOINTS.EVENT_TYPES;
43+
const response = await axios.get(url);
44+
return Promise.resolve(response);
45+
} catch (error) {
46+
return {
47+
message: error.response?.data?.error || error.message,
48+
errorCode: error.response?.status,
49+
status: error.response?.status || 500,
50+
};
51+
}
52+
}
53+
54+
/**
55+
* Fetch available event locations
56+
* @returns {Promise} API response
57+
*/
58+
export async function getEventLocations() {
59+
try {
60+
const url = ENDPOINTS.EVENT_LOCATIONS;
61+
const response = await axios.get(url);
62+
return Promise.resolve(response);
63+
} catch (error) {
64+
return {
65+
message: error.response?.data?.error || error.message,
66+
errorCode: error.response?.status,
67+
status: error.response?.status || 500,
68+
};
69+
}
70+
}

0 commit comments

Comments
 (0)