feat/optional-cooldown #2
@@ -495,7 +495,8 @@ ipcMain.handle('open-external', (event, url: string) => shell.openExternal(url))
|
||||
|
||||
ipcMain.handle('open-steam-login', async (event, expectedSteamId: string) => {
|
||||
const loginSession = session.fromPartition('persist:steam-login');
|
||||
await loginSession.clearStorageData({ storages: ['cookies', 'localstorage', 'indexdb'] });
|
||||
// Removed: automatic clearStorageData to allow cookie persistence
|
||||
|
||||
return new Promise<boolean>((resolve) => {
|
||||
const loginWindow = new BrowserWindow({
|
||||
width: 800, height: 700, parent: mainWindow || undefined, modal: true, title: 'Login to Steam',
|
||||
|
||||
@@ -24,6 +24,7 @@ import PublicIcon from '@mui/icons-material/Public';
|
||||
import ShieldIcon from '@mui/icons-material/Shield';
|
||||
import GppBadIcon from '@mui/icons-material/GppBad';
|
||||
import PeopleIcon from '@mui/icons-material/People';
|
||||
import VerifiedUserIcon from '@mui/icons-material/VerifiedUser';
|
||||
import { useAccounts, type Account } from '../hooks/useAccounts';
|
||||
import { useAppTheme } from '../theme/ThemeContext';
|
||||
import type { ThemeType } from '../theme/SteamTheme';
|
||||
@@ -490,17 +491,53 @@ const AccountRow: React.FC<{
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Box sx={{ display: 'flex', justifyContent: 'flex-end', gap: 0.5 }}>
|
||||
{account?.steamLoginSecure ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'flex-end', gap: 0.5, alignItems: 'center' }}>
|
||||
{/* Fast Switcher Button - Always available if we have a login name */}
|
||||
{account.loginName && (
|
||||
<Button
|
||||
variant="contained" size="small" onClick={() => onSwitch(account.loginName || '')}
|
||||
sx={{ height: 28, fontSize: '0.7rem', bgcolor: 'secondary.main', '&:hover': { opacity: 0.9 } }}
|
||||
variant="contained"
|
||||
size="small"
|
||||
onClick={() => onSwitch(account.loginName || '')}
|
||||
sx={{
|
||||
height: 28,
|
||||
fontSize: '0.7rem',
|
||||
bgcolor: 'secondary.main',
|
||||
'&:hover': { opacity: 0.9 },
|
||||
minWidth: 60
|
||||
}}
|
||||
>
|
||||
LOGIN
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="outlined" size="small" onClick={onAuth} sx={{ height: 28, fontSize: '0.7rem' }}>AUTH</Button>
|
||||
)}
|
||||
|
||||
{/* Scraper Auth Button - Controls the optional cooldown tracking */}
|
||||
<Tooltip title={account.steamLoginSecure && !account.authError ? "Session valid - Tracking active" : (account.steamLoginSecure ? "Refresh scraper session" : "Authenticate for cooldown tracking")}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={onAuth}
|
||||
disabled={!!(account.steamLoginSecure && !account.authError)}
|
||||
sx={{
|
||||
color: account.steamLoginSecure && !account.authError ? 'success.main' : (account.authError ? 'error.main' : 'warning.main'),
|
||||
border: '1px solid',
|
||||
borderColor: account.steamLoginSecure && !account.authError ? 'success.main' : 'divider',
|
||||
borderRadius: 1,
|
||||
opacity: account.steamLoginSecure && !account.authError ? 1 : 1,
|
||||
background: account.steamLoginSecure && !account.authError ? 'rgba(163, 207, 6, 0.1)' : 'transparent'
|
||||
}}
|
||||
>
|
||||
{account.steamLoginSecure && !account.authError ? <VerifiedUserIcon fontSize="inherit" /> : (account.authError ? <LockResetIcon fontSize="inherit" /> : <BoltIcon fontSize="inherit" />)}
|
||||
</IconButton>
|
||||
{account.steamLoginSecure && !account.authError && (
|
||||
<Typography variant="caption" sx={{ color: 'success.main', fontWeight: 'bold', fontSize: '0.6rem', letterSpacing: '0.5px' }}>
|
||||
TRACKING
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
</Tooltip>
|
||||
|
||||
<Divider orientation="vertical" flexItem sx={{ mx: 0.5, my: 0.5 }} />
|
||||
|
||||
<IconButton size="small" onClick={handleOpenShare} disabled={!serverConfig?.token}><ShareIcon fontSize="inherit" sx={{ color: 'primary.main' }}/></IconButton>
|
||||
<IconButton size="small" sx={{ color: 'text.secondary' }} onClick={() => (window as any).electronAPI.openExternal(account?.profileUrl || '')}><OpenInNewIcon fontSize="inherit"/></IconButton>
|
||||
<IconButton size="small" sx={{ color: 'error.main' }} onClick={() => onDelete(account?._id || '')}><DeleteIcon fontSize="inherit"/></IconButton>
|
||||
|
||||
Reference in New Issue
Block a user