fix(bot): issue #143 — sleep mode safety guards + super-admin seed access
- sleepGuard.js: assertShopOpen/redirectIfPaused — blocks write-flows on shop pause, redirects to AI dialog, fallback to sleep message - Blocked: buy/pay/quantity/top-up/deposit/wallet-create when paused - Soft redirect: catalog navigation (country/city/district/category/product) to AI on pause - Read-only flows untouched (purchase history, balance, tx history) - Tests: 10 sleepGuard tests (T1-T6 + alias + fallback), 42 total pass - fix(admin): super-admin seed phrases not blocked by commission (informational only) - wallet test mock updated for sleepGuard
This commit is contained in:
@@ -938,7 +938,7 @@ export function WalletsPage() {
|
||||
<TabsContent value="seed-phrases" className="mt-6 space-y-4">
|
||||
{isSuperAdmin && (
|
||||
<>
|
||||
{/* Commission Warning */}
|
||||
{/* Commission Warning — информационное, НЕ блокирует супер-админа */}
|
||||
{overview && overview.commissionDue > 0 && (
|
||||
<div className="flex items-start gap-3 rounded-lg border border-orange-300 bg-orange-50 p-4 dark:bg-orange-950 dark:border-orange-800">
|
||||
<AlertTriangle className="h-5 w-5 text-orange-500 shrink-0 mt-0.5" />
|
||||
@@ -947,7 +947,7 @@ export function WalletsPage() {
|
||||
Outstanding Commission: ${overview.commissionDue.toFixed(2)}
|
||||
</p>
|
||||
<p className="text-xs text-orange-600 dark:text-orange-400 mt-1">
|
||||
Please pay the outstanding commission before accessing seed phrases.
|
||||
Reminder: the shop commission is due. Super admins always have full access to seed phrases.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -962,7 +962,7 @@ export function WalletsPage() {
|
||||
<Button
|
||||
variant="outline"
|
||||
className="gap-2"
|
||||
disabled={overview && overview.commissionDue > 0}
|
||||
disabled={seedsLoading}
|
||||
>
|
||||
<Lock className="h-4 w-4" />
|
||||
{seedsLoaded ? 'Reload Seed Phrases' : 'Unlock & Load Seed Phrases'}
|
||||
|
||||
Reference in New Issue
Block a user