File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ import AccessControlModal from 'solid-ui/components/access-control-modal'
2828
2929const EXPLORER_PROVIDER_TAG = 'solid-ui-file-explorer-provider'
3030
31+ export function dismissErrorStateOnClose ( errorState ) {
32+ errorState . addEventListener ( 'close' , ( ) => errorState . remove ( ) )
33+ }
34+
3135export default function ( context ) {
3236 const dom = context . dom
3337 const explorerStates = new WeakMap ( )
@@ -1719,6 +1723,7 @@ export default function (context) {
17191723 errorState . setAttribute ( 'title' , 'Access denied' )
17201724 errorState . setAttribute ( 'message' , soloAccessMessage ( ) )
17211725 if ( docUri ) errorState . setAttribute ( 'data-outline-error-for' , docUri )
1726+ dismissErrorStateOnClose ( errorState )
17221727 UI . utils . emptyNode ( p ) . appendChild ( errorState )
17231728 sf . addCallback ( 'done' , function soloAccessRecovered ( uri ) {
17241729 if ( ! soloAccessDenied || ! p . isConnected ) return false
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ vi.mock('pane-registry', () => ({
2828 byName : vi . fn ( )
2929} ) )
3030
31- import OutlineManager from '../../../src/outline/manager'
31+ import OutlineManager , { dismissErrorStateOnClose } from '../../../src/outline/manager'
3232import { onNavigated , type NavigatedDetail } from '../../../src/navigation/events'
3333import { lit , NamedNode , sym , blankNode } from 'rdflib'
3434import { findByText , getByText } from '@testing-library/dom'
@@ -354,6 +354,16 @@ describe('manager', () => {
354354 expect ( isInViewerPodMock ) . not . toHaveBeenCalled ( )
355355 } )
356356
357+ it ( 'removes the solo access-denied message when it is closed' , ( ) => {
358+ const errorState = document . createElement ( 'solid-ui-error-state' )
359+ document . body . appendChild ( errorState )
360+ dismissErrorStateOnClose ( errorState )
361+
362+ errorState . dispatchEvent ( new CustomEvent ( 'close' , { bubbles : true , composed : true } ) )
363+
364+ expect ( document . body . contains ( errorState ) ) . toBe ( false )
365+ } )
366+
357367 it ( 'renders pane and header before menu icons resolve' , async ( ) => {
358368 let resolveIcon ! : ( icon : string ) => void
359369 const icon = new Promise < string > ( resolve => { resolveIcon = resolve } )
You can’t perform that action at this time.
0 commit comments