How to refresh the shared list in the Finder's side panel? In the left side of the Finder, under favorites and devices there is a shared list that contains computers and other devices on the network. I use the MacBook in two places, both with wifi. When I switch between these places, the Mac automatically connects to the wifi network there, but sometimes the Finder's shared list still contains the devices in the previous network.

If I close the laptop's lid and open it again, the list refreshes, but is there any other/better way to trigger the refresh? Why doesn't the refresh happens automatically?
Relaunch the Finder
option+right click [or Ctrl+Opt+left click] the Finder icon in the Dock, last item is Relaunch.
Or try this I found on StackOverflow Automator Command to Refresh ALL Finder/all Finder Windows - works for Finder windows, can't test for Shared items.
tell application &quot;Finder&quot;
    set theWindows to every window
    repeat with i from 1 to number of items in theWindows
        set this_item to item i of theWindows
        set theView to current view of this_item
        if theView is list view then
            set current view of this_item to icon view
        else
            set current view of this_item to list view

        end if
        set current view of this_item to theView
    end repeat


end tell

Or use Terminal app to performing it manually
killall Finder