1
0
mirror of https://github.com/jiriks74/presence.nvim synced 2024-11-23 20:37:50 +01:00

fix(Flatpak): clear sock_path if the flatpak socket wasn't found

This commit is contained in:
Jiří Štefka 2023-09-25 22:11:48 +02:00
parent ff8442c168
commit 0601dd513e
Signed by: jiriks74
GPG Key ID: 1D5E30D3DB2264DE

@ -397,6 +397,8 @@ function Presence:get_discord_socket_path()
xdg_path = xdg_path and xdg_path:match("/$") and xdg_path.."app/com.discordapp.Discord" or xdg_path.."/app/com.discordapp.Discord"
self.log:debug(string.format("Using XDG runtime path: %s", xdg_path))
sock_path = xdg_path:match("/$") and xdg_path..sock_name or xdg_path.."/"..sock_name
-- Check if the socket path exists and if not set it to nil
sock_path = vim.fn.filereadable(sock_path) == 1 and sock_path or nil
end
-- If the socket path is still nil, check other temp directories