fix(app): collapse nested if in useImpersonationStore
WS-3 session 1b-iii follow-up — sonarjs/no-collapsible-if. useImpersonationStore.ts:103: collapsed nested 'if (state.value)' into the parent 'else if (data.data.session)' clause. Both legs are AND-conditions on the same path, so the merge is semantically identical. Brings the apps/app lint baseline to 0 problems. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -100,12 +100,10 @@ export const useImpersonationStore = defineStore('impersonation', () => {
|
||||
clearState()
|
||||
window.location.href = '/platform'
|
||||
}
|
||||
else if (data.data.session) {
|
||||
else if (data.data.session && state.value) {
|
||||
// Update expiry from server
|
||||
if (state.value) {
|
||||
state.value.expiresAt = data.data.session.expires_at
|
||||
persistState()
|
||||
}
|
||||
state.value.expiresAt = data.data.session.expires_at
|
||||
persistState()
|
||||
}
|
||||
}
|
||||
catch {
|
||||
|
||||
Reference in New Issue
Block a user