mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-22 13:28:04 -05:00
fix(stores): consolidated some store values
This commit is contained in:
@@ -152,7 +152,13 @@ export default function LoginPage() {
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Input id="password" name="password" type="password" required />
|
||||
<Input
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
placeholder="Enter your password"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={isLoading}>
|
||||
{isLoading ? 'Signing in...' : 'Sign in'}
|
||||
|
||||
@@ -32,7 +32,7 @@ import { NotificationDropdownItem } from './components/notification-dropdown-ite
|
||||
|
||||
export function ControlBar() {
|
||||
const { notifications, getWorkflowNotifications } = useNotificationStore()
|
||||
const { history, undo, redo, revertToHistoryState } = useWorkflowStore()
|
||||
const { history, undo, redo, revertToHistoryState, lastSaved } = useWorkflowStore()
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
const [editedName, setEditedName] = useState('')
|
||||
const { workflows, updateWorkflow, activeWorkflowId, removeWorkflow } = useWorkflowRegistry()
|
||||
@@ -125,10 +125,10 @@ export function ControlBar() {
|
||||
{activeWorkflowId ? workflows[activeWorkflowId].name : 'Workflow'}
|
||||
</h2>
|
||||
)}
|
||||
{mounted && ( // Only render the timestamp after client-side hydration
|
||||
{mounted && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Saved{' '}
|
||||
{formatDistanceToNow(history.present.timestamp, {
|
||||
{formatDistanceToNow(lastSaved || Date.now(), {
|
||||
addSuffix: true,
|
||||
})}
|
||||
</p>
|
||||
|
||||
@@ -20,6 +20,8 @@ export function General() {
|
||||
const router = useRouter()
|
||||
const isAutoConnectEnabled = useGeneralStore((state) => state.isAutoConnectEnabled)
|
||||
const toggleAutoConnect = useGeneralStore((state) => state.toggleAutoConnect)
|
||||
const isDebugModeEnabled = useGeneralStore((state) => state.isDebugModeEnabled)
|
||||
const toggleDebugMode = useGeneralStore((state) => state.toggleDebugMode)
|
||||
|
||||
const handleResetData = () => {
|
||||
resetAllStores()
|
||||
@@ -35,7 +37,11 @@ export function General() {
|
||||
<Label htmlFor="debug-mode" className="font-medium">
|
||||
Debug mode
|
||||
</Label>
|
||||
<Switch id="debug-mode" />
|
||||
<Switch
|
||||
id="debug-mode"
|
||||
checked={isDebugModeEnabled}
|
||||
onCheckedChange={toggleDebugMode}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center justify-between py-1">
|
||||
<Label htmlFor="auto-connect" className="font-medium">
|
||||
|
||||
Reference in New Issue
Block a user