fixed notification drawer linking to team/id instead of teams/id
This commit is contained in:
parent
900b11582b
commit
6dab685c2d
5 changed files with 3 additions and 8 deletions
|
|
@ -16,7 +16,6 @@ function App() {
|
|||
|
||||
const whiteLabel = getWhitelabel()
|
||||
const manifestPath = "/" + whiteLabel.name.replace(/\s/g, "") + "/manifest.json"
|
||||
// const defaultPath = "/AdaptiveAgriculture/manifest.json";
|
||||
const manifestDocument = document.getElementById('manifest-link') as HTMLLinkElement
|
||||
|
||||
fetch(manifestPath).then(response => {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ export default function NotificationDrawer(props: Props) {
|
|||
setNotifications(new Map());
|
||||
if (!notification.settings?.sourceType) 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
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ export default function Router(props: Props) {
|
|||
|
||||
{/* Redirects */}
|
||||
<Route path="/callback" element={<Navigate to="/" />} />
|
||||
<Route path="/team/:teamID" element={<Navigate to="/teams/:teamID" />} />
|
||||
<Route path="/device/:deviceID" element={<Navigate to="/devices/:devicesID" />} />
|
||||
{/* <Route path="/team/:teamID" element={<Navigate to="/teams/:teamID" />} /> */}
|
||||
{/* <Route path="/device/:deviceID" element={<Navigate to="/devices/:devicesID" />} /> */}
|
||||
|
||||
{/* Page routes */}
|
||||
<Route index element={<Typography>Hello!</Typography>} />
|
||||
|
|
|
|||
|
|
@ -169,7 +169,6 @@ export default function Devices() {
|
|||
if (groupsLoading) return
|
||||
if (groups.length > 0) return
|
||||
setGroupsLoading(true)
|
||||
console.log("groups")
|
||||
groupAPI.listGroups(
|
||||
groupLimit,
|
||||
groupPage*groupLimit,
|
||||
|
|
|
|||
|
|
@ -79,10 +79,7 @@ export default function HTTPProvider(props: Props) {
|
|||
|
||||
function get<T>(url: string, spreadOptions?: AxiosRequestConfig): Promise<AxiosResponse<T>> {
|
||||
if (isTokenExpired(token)) {
|
||||
console.log("token expired")
|
||||
loginWithPopup()
|
||||
} else {
|
||||
console.log("token is fine")
|
||||
}
|
||||
return axios.get(url, {...defaultOptions(), ...spreadOptions});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue