From 0601dd513ee2a1f0286245a6843b9b64cea5af87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 25 Sep 2023 22:11:48 +0200 Subject: [PATCH] fix(Flatpak): clear sock_path if the flatpak socket wasn't found --- lua/presence/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 5018ab8..d3ddd70 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -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