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 serde::{Deserialize, Serialize};
use std::fs;
use std::path::{Path, PathBuf};
use std::path::Path;
use tauri::{AppHandle, Emitter, Listener, Manager, Runtime, WebviewWindow};
use ts_rs::TS;

View File

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

View File

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