web/satellite: fix billing page nav on all dashboard
This change fixes an issue where clicking "Billing" on all projects dashboard won't navigate to the billing page. This also makes sure an error notification for projectID is not shown after the user is back on the all projects dashboard from team page. related: https://github.com/storj/storj/issues/5875 Change-Id: Ie6517c9006d1a780f307f6282f83c749d369adaf
This commit is contained in:
parent
f1b9f6b672
commit
e9fc4e9d0f
@ -77,11 +77,18 @@ const isBalanceDropdownShown = computed((): boolean => {
|
||||
return appStore.state.activeDropdown === APP_STATE_DROPDOWNS.AVAILABLE_BALANCE;
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns whether we're on the settings/billing page on the all projects dashboard.
|
||||
*/
|
||||
const isOnAllDashboardSettings = computed((): boolean => {
|
||||
return router.currentRoute.path.includes(RouteConfig.AccountSettings.path);
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the base account route based on if we're on all projects dashboard.
|
||||
*/
|
||||
const baseAccountRoute = computed((): NavigationLink => {
|
||||
if (router.currentRoute.path.includes(RouteConfig.AccountSettings.path)) {
|
||||
if (isOnAllDashboardSettings.value) {
|
||||
return RouteConfig.AccountSettings;
|
||||
}
|
||||
|
||||
@ -144,7 +151,7 @@ function routeToCoupons(): void {
|
||||
* Fetches account balance.
|
||||
*/
|
||||
onMounted(async (): Promise<void> => {
|
||||
if (configStore.state.config.allProjectsDashboard && !projectsStore.state.selectedProject.id) {
|
||||
if (!isOnAllDashboardSettings.value && !projectsStore.state.selectedProject.id) {
|
||||
await router.push(RouteConfig.AllProjectsDashboard.path);
|
||||
return;
|
||||
}
|
||||
|
@ -172,6 +172,11 @@ async function processSearchQuery(search: string): Promise<void> {
|
||||
* Set up listener to clear search bar.
|
||||
*/
|
||||
onMounted((): void => {
|
||||
if (configStore.state.config.allProjectsDashboard && !projectsStore.state.selectedProject.id) {
|
||||
// navigation back to the all projects dashboard is done in ProjectMembersArea.vue
|
||||
return;
|
||||
}
|
||||
|
||||
pmStore.$onAction(({ name, after, args }) => {
|
||||
if (name === 'setSearchQuery' && args[0] === '') {
|
||||
after((_) => searchInput.value?.clearSearch());
|
||||
|
Loading…
Reference in New Issue
Block a user