fix(subscription): invalidate devices query after revoke

On revoke, RemnaWave panel clears all device HWIDs along with the
subscription URL rotation, but the cabinet was only invalidating
['subscription'], ['connection-link'], ['subscriptions-list'] — leaving
['devices', subscriptionId] cached. UI showed the now-stale device list
until the user manually refreshed.

The GET /subscription/devices endpoint reads HWIDs live from RemnaWave
(no DB cache to clear), so invalidating the TanStack query is
sufficient — the immediate refetch returns the now-empty device list.
This commit is contained in:
Fringg
2026-05-16 04:34:32 +03:00
parent e964780e6f
commit 47f0359ed6

View File

@@ -518,6 +518,9 @@ export default function Subscription() {
queryClient.invalidateQueries({ queryKey: ['subscription'] });
queryClient.invalidateQueries({ queryKey: ['connection-link', subscriptionId] });
queryClient.invalidateQueries({ queryKey: ['subscriptions-list'] });
// RemnaWave resets device HWIDs on revoke — make sure the cabinet
// re-reads the now-empty device list instead of showing the stale cache.
queryClient.invalidateQueries({ queryKey: ['devices', subscriptionId] });
haptic.notification('success');
localStorage.setItem(`revoke_ts_${subscriptionId ?? 'default'}`, Date.now().toString());
setRevokeCooldown(900);