mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user