// No server-rendered flag for this exists, and adding one would be more // plumbing than reusing what's already on the page: the topbar's own // logged_in check (views/index.erb) already renders a "Log out" link only // when logged in. Login state never changes without a full page reload // (there's no client-side login/logout), so this only needs checking once // per use, not reactively/on an event. export function isLoggedIn() { return !!document.querySelector('a[href="/logout"]'); }