Fix sidebar active link highlight
This commit is contained in:
		
							parent
							
								
									ca866a7f80
								
							
						
					
					
						commit
						4dd2a16d07
					
				| 
						 | 
					@ -12,7 +12,7 @@
 | 
				
			||||||
  <p class="menu-label">Chats</p>
 | 
					  <p class="menu-label">Chats</p>
 | 
				
			||||||
  <ul class="menu-list">
 | 
					  <ul class="menu-list">
 | 
				
			||||||
    {#if sortedChats.length === 0}
 | 
					    {#if sortedChats.length === 0}
 | 
				
			||||||
      <li><a class="panel-block" href={"#"}>No chats yet...</a></li>
 | 
					      <li><a href={"#"}>No chats yet...</a></li>
 | 
				
			||||||
    {:else}
 | 
					    {:else}
 | 
				
			||||||
      <li>
 | 
					      <li>
 | 
				
			||||||
        <ul>
 | 
					        <ul>
 | 
				
			||||||
| 
						 | 
					@ -20,9 +20,8 @@
 | 
				
			||||||
            <li>
 | 
					            <li>
 | 
				
			||||||
              <a
 | 
					              <a
 | 
				
			||||||
                href={"#"}
 | 
					                href={"#"}
 | 
				
			||||||
                class="panel-block"
 | 
					 | 
				
			||||||
                class:is-disabled={!apiKey}
 | 
					                class:is-disabled={!apiKey}
 | 
				
			||||||
                class:has-background-light={activeChatId === chat.id}
 | 
					                class:is-active={activeChatId === chat.id}
 | 
				
			||||||
                on:click|preventDefault={() => (activeChatId = chat.id)}>{chat.name || `Chat ${chat.id}`}</a
 | 
					                on:click|preventDefault={() => (activeChatId = chat.id)}>{chat.name || `Chat ${chat.id}`}</a
 | 
				
			||||||
              >
 | 
					              >
 | 
				
			||||||
            </li>
 | 
					            </li>
 | 
				
			||||||
| 
						 | 
					@ -38,7 +37,7 @@
 | 
				
			||||||
        href={"#"}
 | 
					        href={"#"}
 | 
				
			||||||
        class="panel-block"
 | 
					        class="panel-block"
 | 
				
			||||||
        class:is-disabled={!apiKey}
 | 
					        class:is-disabled={!apiKey}
 | 
				
			||||||
        class:has-background-light={!activeChatId}
 | 
					        class:is-active={!activeChatId}
 | 
				
			||||||
        on:click|preventDefault={() => {
 | 
					        on:click|preventDefault={() => {
 | 
				
			||||||
          activeChatId = null;
 | 
					          activeChatId = null;
 | 
				
			||||||
        }}><span class="greyscale mr-2">🔑</span> API key</a
 | 
					        }}><span class="greyscale mr-2">🔑</span> API key</a
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue