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()
|
clearState()
|
||||||
window.location.href = '/platform'
|
window.location.href = '/platform'
|
||||||
}
|
}
|
||||||
else if (data.data.session) {
|
else if (data.data.session && state.value) {
|
||||||
// Update expiry from server
|
// Update expiry from server
|
||||||
if (state.value) {
|
state.value.expiresAt = data.data.session.expires_at
|
||||||
state.value.expiresAt = data.data.session.expires_at
|
persistState()
|
||||||
persistState()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user