fixed notification drawer linking to team/id instead of teams/id

This commit is contained in:
Carter 2025-02-27 14:26:14 -06:00
parent 900b11582b
commit 6dab685c2d
5 changed files with 3 additions and 8 deletions

View file

@ -16,7 +16,6 @@ function App() {
const whiteLabel = getWhitelabel() const whiteLabel = getWhitelabel()
const manifestPath = "/" + whiteLabel.name.replace(/\s/g, "") + "/manifest.json" const manifestPath = "/" + whiteLabel.name.replace(/\s/g, "") + "/manifest.json"
// const defaultPath = "/AdaptiveAgriculture/manifest.json";
const manifestDocument = document.getElementById('manifest-link') as HTMLLinkElement const manifestDocument = document.getElementById('manifest-link') as HTMLLinkElement
fetch(manifestPath).then(response => { fetch(manifestPath).then(response => {

View file

@ -139,7 +139,7 @@ export default function NotificationDrawer(props: Props) {
setNotifications(new Map()); setNotifications(new Map());
if (!notification.settings?.sourceType) return; if (!notification.settings?.sourceType) return;
if (!notification.settings?.sourceKey) return; if (!notification.settings?.sourceKey) return;
let url = "/" + notification.settings?.sourceType + "/" + notification.settings?.sourceKey; let url = "/" + notification.settings?.sourceType + "s/" + notification.settings?.sourceKey;
history(url); //in order to update the history stack add '{ replace: true }' as a second parameter history(url); //in order to update the history stack add '{ replace: true }' as a second parameter
}; };

View file

@ -152,8 +152,8 @@ export default function Router(props: Props) {
{/* Redirects */} {/* Redirects */}
<Route path="/callback" element={<Navigate to="/" />} /> <Route path="/callback" element={<Navigate to="/" />} />
<Route path="/team/:teamID" element={<Navigate to="/teams/:teamID" />} /> {/* <Route path="/team/:teamID" element={<Navigate to="/teams/:teamID" />} /> */}
<Route path="/device/:deviceID" element={<Navigate to="/devices/:devicesID" />} /> {/* <Route path="/device/:deviceID" element={<Navigate to="/devices/:devicesID" />} /> */}
{/* Page routes */} {/* Page routes */}
<Route index element={<Typography>Hello!</Typography>} /> <Route index element={<Typography>Hello!</Typography>} />

View file

@ -169,7 +169,6 @@ export default function Devices() {
if (groupsLoading) return if (groupsLoading) return
if (groups.length > 0) return if (groups.length > 0) return
setGroupsLoading(true) setGroupsLoading(true)
console.log("groups")
groupAPI.listGroups( groupAPI.listGroups(
groupLimit, groupLimit,
groupPage*groupLimit, groupPage*groupLimit,

View file

@ -79,10 +79,7 @@ export default function HTTPProvider(props: Props) {
function get<T>(url: string, spreadOptions?: AxiosRequestConfig): Promise<AxiosResponse<T>> { function get<T>(url: string, spreadOptions?: AxiosRequestConfig): Promise<AxiosResponse<T>> {
if (isTokenExpired(token)) { if (isTokenExpired(token)) {
console.log("token expired")
loginWithPopup() loginWithPopup()
} else {
console.log("token is fine")
} }
return axios.get(url, {...defaultOptions(), ...spreadOptions}); return axios.get(url, {...defaultOptions(), ...spreadOptions});
} }