Fix redirecting to latest workspace

This commit is contained in:
Gregory Schier
2025-01-08 22:08:59 -08:00
parent 328e3db56e
commit 0a7257c55a
3 changed files with 8 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ use sea_query::{Cond, Expr, OnConflict, Order, Query, SqliteQueryBuilder};
use sea_query_rusqlite::RusqliteBinder; use sea_query_rusqlite::RusqliteBinder;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::Path;
use tauri::{AppHandle, Emitter, Listener, Manager, Runtime, WebviewWindow}; use tauri::{AppHandle, Emitter, Listener, Manager, Runtime, WebviewWindow};
use ts_rs::TS; use ts_rs::TS;

View File

@@ -1,14 +1,16 @@
import type { LicenseCheckStatus } from '@yaakapp-internal/license'; import type { LicenseCheckStatus } from '@yaakapp-internal/license';
import { useLicense } from '@yaakapp-internal/license'; import { useLicense } from '@yaakapp-internal/license';
import { appInfo } from '../hooks/useAppInfo';
import { useOpenSettings } from '../hooks/useOpenSettings'; import { useOpenSettings } from '../hooks/useOpenSettings';
import type { ButtonProps } from './core/Button'; import type { ButtonProps } from './core/Button';
import { Button } from './core/Button'; import { Button } from './core/Button';
import {SettingsTab} from "./Settings/SettingsTab"; import { SettingsTab } from './Settings/SettingsTab';
const details: Record< const details: Record<
LicenseCheckStatus['type'], LicenseCheckStatus['type'] | 'dev',
{ label: string; color: ButtonProps['color'] } | null { label: string; color: ButtonProps['color'] } | null
> = { > = {
dev: { label: 'Develop', color: 'secondary' },
commercial_use: null, commercial_use: null,
invalid_license: { label: 'License Error', color: 'danger' }, invalid_license: { label: 'License Error', color: 'danger' },
personal_use: { label: 'Personal Use', color: 'primary' }, personal_use: { label: 'Personal Use', color: 'primary' },
@@ -23,7 +25,8 @@ export function LicenseBadge() {
return null; return null;
} }
const detail = details[check.data.type]; const checkType = appInfo.isDev ? 'dev' : check.data.type;
const detail = details[checkType];
if (detail == null) { if (detail == null) {
return null; return null;
} }

View File

@@ -25,7 +25,7 @@ export function RedirectToLatestWorkspace() {
const search = { const search = {
cookie_jar_id: cookieJarId, cookie_jar_id: cookieJarId,
environment_id: environmentId, environment_id: environmentId,
requestId: requestId, request_id: requestId,
}; };
await router.navigate({ to: '/workspaces/$workspaceId', params, search }); await router.navigate({ to: '/workspaces/$workspaceId', params, search });